class TestMathFunc(unittest.TestCase):
'''
skip无条件跳过
unittest.skip(reason)
skipIf当condition为True时跳过
unittest.skipIf(condition, reason)
skipUnless当condition为False时跳过
unittest.skipUnless(condition, reason)
'''
# @unittest.skip("I don't want to run this case.")
@unittest.skipIf(False,'tiaoguo')
def test_add(self):
self.assertEqual(2,add(2,3))
self.assertEqual(5,add(3,2))
Python unittest 小结
最新推荐文章于 2023-11-03 13:49:21 发布