Suppose I've got a few modules with test cases derived from unittest.TestCase
. All those modules reside in one package test
:
test/
test_case1.py
test_case2.py
test_case3.py
I'd like to run all tests in all modules in test
with one shell command. In order to do it I've added a new module test_all.py
, which creates a TestSuite
with all the test cases, and main
:
def make_suite():
... # add test cases explicitly one by one
if __name__ == "__main__":
suite = make_suite()
unittest.TextTestRunner().run(suite)
Now I wonder if there is a way to run all the test cases in test
without making a TestSuite