In order to run all my unittests I use following script where test_files is a list of strings of my testfiles:
for test_file in test_files:
test_file = test_file[:-3]
module = __import__(test_file)
for name, obj in inspect.getmembers(module):
if inspect.isclass(obj):
if str(obj).startswith("<class 'test_"):
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(obj))
How can I remove single tests from the suite afterwards (not all tests from a testfile)?