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

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