From 96868ec9c8592ff2f7fd3a9a4e3f2d7f6df9fcc0 Mon Sep 17 00:00:00 2001 From: Anthony De Bortoli Date: Fri, 28 Dec 2018 19:40:01 +0100 Subject: [PATCH 1/2] Add requirements.txt file --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 requirements.txt 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 From d8e57780febfba31d2c33c8b7061e8c8b299e469 Mon Sep 17 00:00:00 2001 From: Anthony De Bortoli Date: Fri, 28 Dec 2018 19:40:33 +0100 Subject: [PATCH 2/2] Update run_all tests to make it run in pycharm --- control/tests/run_all.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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):