execute linking tests only when explicitely requested via PYSAM_LINKING_TESTS env...
authorAndreas Heger <andreas.heger@gmail.com>
Mon, 18 Sep 2017 10:19:28 +0000 (11:19 +0100)
committerMattia Rizzolo <mattia@debian.org>
Fri, 10 Nov 2017 11:56:10 +0000 (11:56 +0000)
Gbp-Pq: Name execute-linking-tests-only-when-explicitely-reque.patch

.travis.yml
tests/TestUtils.py
tests/linking_test.py

index bfc5d1ce0d7cf9fed7fa5c3a8be0319695ba6ad4..f874a90fef82019016cd4e94051da9bdd0202551 100644 (file)
@@ -11,6 +11,8 @@ env:
     - CONDA_PY=3.4
     - CONDA_PY=3.5
     - CONDA_PY=3.6
+  global:
+    - PYSAM_LINKING_TEST=1
 
 addons:
   apt:
index dc95e095617f9d70c9711205377e769cfdf749a0..940c272ee5558c3513f0adea8cb5a270814fc5fd 100644 (file)
@@ -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
index 623c3a22dabed2959993b88ca1fd3e84078dc651..ad76a4573902882d52560098eed9fe93f05d691e 100644 (file)
@@ -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"