Test: add a def to run all test case clases from a test module
This commit is contained in:
committed by
Yorik van Havre
parent
e8290f95c5
commit
0a387ea8e9
@@ -1,5 +1,9 @@
|
||||
import unittest
|
||||
|
||||
def runTest(test_case, verbosity=2):
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(test_case)
|
||||
def runTestsFromClass(test_case_class, verbosity=2):
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(test_case_class)
|
||||
unittest.TextTestRunner(verbosity=verbosity).run(suite)
|
||||
|
||||
def runTestsFromModule(test_module, verbosity=2):
|
||||
suite = unittest.TestLoader().loadTestsFromModule(test_module)
|
||||
unittest.TextTestRunner(verbosity=verbosity).run(suite)
|
||||
|
||||
Reference in New Issue
Block a user