#导入测试内置模块
import unittest
#导入要测试的api
from _try_except import condition
#需要继承unittest.TestCase,def函数必须用test_开头
class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(condition(),1)
深耕网站建设、视觉设计与SEO优化的一线实战洞察。
#导入测试内置模块
import unittest
#导入要测试的api
from _try_except import condition
#需要继承unittest.TestCase,def函数必须用test_开头
class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(condition(),1)