17 Creates a Test Suite from all the tests inside a python package which is located in the MeVisLab Repository.
19 Example usage inside a MeVisLab TestCenter Test:
21 from TestSupport.UnitTestDiscovery import getSuiteFromPackage
22 import my_module.core.tests
25 def UNITTEST_My_Module():
26 return getSuiteFromPackage(my_module.core.tests)
28 :param unitTestRootPackage: the python package in which unit tests are searched
29 :type unitTestRootPackage: ModuleType
30 :param pattern: Only test files that match the pattern will be loaded.
32 More details can be found in the documentation of the TestLoader.discover() function.
34 searchPath = unitTestRootPackage.__path__[0]
38 return unittest.TestLoader().discover(searchPath, pattern, top_level_dir=top_level_dir)