单个的测试方法或类都可以使用unittest.skip
装饰器禁用。
@unittest.skip("reason for skipping")
def test_foo():
print('This is foo test case.')
@unittest.skip # no reason needed
def test_bar():
print('This is bar test case.')
有关其他选项,请参阅文档“跳过测试和预期的失败”。
暂时禁用单个Python单元测试
单个的测试方法或类都可以使用unittest.skip
装饰器禁用。
@unittest.skip("reason for skipping")
def test_foo():
print('This is foo test case.')
@unittest.skip # no reason needed
def test_bar():
print('This is bar test case.')
有关其他选项,请参阅文档“跳过测试和预期的失败”。