📅 发布时间:2026/6/22 6:29:01 Python测试(上)_ 不存在不写bug的程序员 #导入测试内置模块import unittest#导入要测试的apifrom _try_except import condition#需要继承unittest.TestCase,def函数必须用test_开头class MyTestCase(unittest.TestCase): def test_something(self): self.assertEqual(condition(),1)