diff --git a/control/tests/run_all.py b/control/tests/run_all.py index b21248432..d713e7a3b 100755 --- a/control/tests/run_all.py +++ b/control/tests/run_all.py @@ -8,6 +8,7 @@ import re # regular expressions import os # operating system commands + def test_all(verbosity=0): """ Runs all tests written for python-control. """ @@ -15,16 +16,12 @@ def test_all(verbosity=0): start_dir = './' pattern = '*_test.py' top_level_dir = '../' - testModules = \ - unittest.defaultTestLoader.discover(start_dir, pattern=pattern, \ - top_level_dir=top_level_dir) - - for mod in test_mods: - print('Running tests in', mod) - tests = unittest.defaultTestLoader.loadTestFromModule(mod) + test_mods = unittest.defaultTestLoader.discover(start_dir, pattern=pattern, + top_level_dir=top_level_dir) + for suite in test_mods: + print("Running tests in: ", suite) t = unittest.TextTestRunner() - t.run(tests) - print('Completed tests in', mod) + t.run(suite) except: testModules = findTests('./tests/') @@ -33,8 +30,8 @@ def test_all(verbosity=0): for mod in testModules: print('Running tests in', mod) suiteList=[] # list of unittest.TestSuite objects - exec('import '+mod+' as currentModule') - + exec('import control.tests.'+mod+' as currentModule') + print(currentModule.suite()) try: currentSuite = currentModule.suite() if isinstance(currentSuite, unittest.TestSuite): diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..fea59b9a4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +matplotlib +numpy +scipy +slycot \ No newline at end of file