How can individual unit tests be temporarily disabled when using the unittest
module in Python?
You can use decorators to disable the test that can wrap the function and prevent the googletest or python unit test to run the testcase.
def disabled(f):
def _decorator():
print f.__name__ + ' has been disabled'
return _decorator
@disabled
def testFoo():
'''Foo test case'''
print 'this is foo test case'
testFoo()
Output:
testFoo has been disabled