From 97da16f4bc23b3de0dbf2ef38257246ba4b45b5b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 14 Oct 2011 12:12:06 +0200 Subject: [PATCH] load test suites Signed-off-by: Nico Schottelius --- lib/cdist/test/__main__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/cdist/test/__main__.py b/lib/cdist/test/__main__.py index 136e122a..eba262fa 100644 --- a/lib/cdist/test/__main__.py +++ b/lib/cdist/test/__main__.py @@ -33,17 +33,19 @@ for possible_test in os.listdir(base_dir): filename = "__init__.py" mod_path = os.path.join(base_dir, possible_test, filename) - print(mod_path + "x") - if os.path.isfile(mod_path): test_modules.append(possible_test) print(sys.path) +suites = [] + for test_module in test_modules: module = imp.find_module(test_module, [base_dir]) imp.load_module(test_module, *module) -#suite = unittest.defaultTestLoader.loadTestsFromModule(cdist.test.code) - + print(module) + # module_name = + suite = unittest.defaultTestLoader.loadTestsFromModule("cdist.test." + test_module) + suites.append(suite)