From 1757ff0bbf493940a0a5cd7c17750ca755ec2fb8 Mon Sep 17 00:00:00 2001 From: "Scott C. Livingston" Date: Tue, 14 Feb 2017 10:10:36 -0500 Subject: [PATCH 1/2] TEST: Add run of tests without Slycot on TravisCI --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 247ff2d86..33aca5703 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ before_install: - conda install conda-build - conda config --add channels python-control - conda info -a - - conda create -q -n test-environment python="$TRAVIS_PYTHON_VERSION" pip coverage slycot + - conda create -q -n test-environment python="$TRAVIS_PYTHON_VERSION" pip coverage - source activate test-environment # coveralls not in conda repos - pip install coveralls @@ -45,6 +45,11 @@ install: # command to run tests script: + # Before installing Slycot + - python setup.py test + + # Now, get and use Slycot + - conda install slycot - coverage run setup.py test after_success: From a7e0bba580d4cd892f7f540bcd619bab9647868c Mon Sep 17 00:00:00 2001 From: "Scott C. Livingston" Date: Tue, 14 Feb 2017 10:17:35 -0500 Subject: [PATCH 2/2] TEST: Disable tests that depend on Slycot if absent testBalredMatchDC, testGramRc, testGramRo which were introduced in PR #118 use functions that depend on Slycot, so the tests should be skipped if it is not found. --- control/tests/modelsimp_test.py | 1 + control/tests/statefbk_test.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/control/tests/modelsimp_test.py b/control/tests/modelsimp_test.py index c3e2296a7..f4bc0fd98 100644 --- a/control/tests/modelsimp_test.py +++ b/control/tests/modelsimp_test.py @@ -107,6 +107,7 @@ def testBalredTruncate(self): np.testing.assert_array_almost_equal(rsys.C, Crtrue,decimal=4) np.testing.assert_array_almost_equal(rsys.D, Drtrue,decimal=4) + @unittest.skipIf(not slycot_check(), "slycot not installed") def testBalredMatchDC(self): #controlable canonical realization computed in matlab for the transfer function: # num = [1 11 45 32], den = [1 15 60 200 60] diff --git a/control/tests/statefbk_test.py b/control/tests/statefbk_test.py index dbef9a915..34070aca7 100644 --- a/control/tests/statefbk_test.py +++ b/control/tests/statefbk_test.py @@ -71,6 +71,7 @@ def testGramWc(self): Wc = gram(sys,'c') np.testing.assert_array_almost_equal(Wc, Wctrue) + @unittest.skipIf(not slycot_check(), "slycot not installed") def testGramRc(self): A = np.matrix("1. -2.; 3. -4.") B = np.matrix("5. 6.; 7. 8.") @@ -103,6 +104,7 @@ def testGramWo2(self): Wo = gram(sys,'o') np.testing.assert_array_almost_equal(Wo, Wotrue) + @unittest.skipIf(not slycot_check(), "slycot not installed") def testGramRo(self): A = np.matrix("1. -2.; 3. -4.") B = np.matrix("5. 6.; 7. 8.")