diff --git a/tests/testsuite.py b/tests/testsuite.py index d45780713226d8ffdb8c58d211adcb1cf3dbaf64..ae82dffe0095b0b95d37d60525dc4b0d86acf144 100644 --- a/tests/testsuite.py +++ b/tests/testsuite.py @@ -1,15 +1,15 @@ import glob import unittest import os - +from os.path import dirname, relpath, abspath def module_strings(): - test_file_paths = glob.glob('test_*.py') + test_file_paths = [] #test_file_strings.extend(glob.glob('../wetb/**/test_*.py')) #for root,_,_ in os.walk("../wetb/"): - for folder, _, _ in os.walk(os.path.join(os.path.dirname(__file__), '../wetb')): - test_file_paths.extend(glob.glob(os.path.join(folder, "tests/test_*.py"))) - return [s[3:len(s) - 3].replace(os.path.sep, ".") for s in test_file_paths] + for folder, _, _ in os.walk(os.path.abspath(dirname(__file__) + '/../wetb/')): + test_file_paths.extend(glob.glob(folder + "/tests/test_*.py")) + return [relpath(s, abspath(dirname(__file__) + "/../")).replace(".py", "").replace(os.path.sep, ".") for s in test_file_paths] def suite(): @@ -60,4 +60,4 @@ else: for mstr in module_strings(): print (mstr) __import__(mstr, {}, {}, "*") - exec("from %s import *" % mstr) \ No newline at end of file + exec("from %s import *" % mstr)