Python的unittest模块有几个修饰符:
有一个简单的老@skip
:
from unittest import skip
@skip("Don't want to test")
def test_something():
...
如果你因为某些原因不能使用@skip
,@skipIf
应该可以.只需欺骗它,使其始终跳过参数True
:
@skipIf(True, "I don't want to run this test yet")
def test_something():
...
如果您只是希望不运行某些测试文件,最好的方法可能是使用fab
或其他工具运行特定的测试.