From c9206552a27505dd760dd88e23827629d109b1c1 Mon Sep 17 00:00:00 2001 From: Andreas Heger Date: Mon, 18 Sep 2017 11:19:28 +0100 Subject: [PATCH] execute linking tests only when explicitely requested via PYSAM_LINKING_TESTS env var. Keep on travis. Fixes #534 Gbp-Pq: Name execute-linking-tests-only-when-explicitely-reque.patch --- .travis.yml | 2 ++ tests/TestUtils.py | 1 + tests/linking_test.py | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index bfc5d1c..f874a90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ env: - CONDA_PY=3.4 - CONDA_PY=3.5 - CONDA_PY=3.6 + global: + - PYSAM_LINKING_TEST=1 addons: apt: diff --git a/tests/TestUtils.py b/tests/TestUtils.py index dc95e09..940c272 100644 --- a/tests/TestUtils.py +++ b/tests/TestUtils.py @@ -23,6 +23,7 @@ LINKDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "linker_ IS_PYTHON3 = sys.version_info[0] >= 3 + if IS_PYTHON3: from itertools import zip_longest from urllib.request import urlopen diff --git a/tests/linking_test.py b/tests/linking_test.py index 623c3a2..ad76a45 100644 --- a/tests/linking_test.py +++ b/tests/linking_test.py @@ -31,6 +31,9 @@ def check_tests_pass(statement): return True +@unittest.skipUnless( + os.environ.get("PYSAM_LINKING_TESTS", None), + "enable linking tests by setting PYSAM_LINKING_TESTS environment variable") class TestLinking(unittest.TestCase): package_name = "link_with_rpath" @@ -43,6 +46,10 @@ class TestLinking(unittest.TestCase): "cd {} && rm -rf build && python setup.py install".format(self.workdir), shell=True) + +@unittest.skipUnless( + os.environ.get("PYSAM_LINKING_TESTS", None), + "enable linking tests by setting PYSAM_LINKING_TESTS environment variable") class TestLinkWithRpath(TestLinking): package_name = "link_with_rpath" @@ -52,6 +59,9 @@ class TestLinkWithRpath(TestLinking): "cd {} && python test_module.py".format(os.path.join(self.workdir, "tests")))) +@unittest.skipUnless( + os.environ.get("PYSAM_LINKING_TESTS", None), + "enable linking tests by setting PYSAM_LINKING_TESTS environment variable") class TestLinkWithoutRpath(TestLinking): package_name = "link_without_rpath" -- 2.30.2