diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2018-04-09 02:06:22 +0200 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2018-04-09 02:06:22 +0200 |
commit | dce770c0a78ae1a99a53d62faae5b52dbbd5cd03 (patch) | |
tree | 638c6378752231b74c39c092d880109e4aaca117 /run_unittests.py | |
parent | 5b13742ff4dfbede24f24447585ad6501bb2f0ff (diff) | |
download | meson-dce770c0a78ae1a99a53d62faae5b52dbbd5cd03.zip meson-dce770c0a78ae1a99a53d62faae5b52dbbd5cd03.tar.gz meson-dce770c0a78ae1a99a53d62faae5b52dbbd5cd03.tar.bz2 |
[fixup]: Fix python2 detection and unit test
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/run_unittests.py b/run_unittests.py index 3767da4..879048b 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2858,9 +2858,19 @@ class PythonTests(BasePlatformTests): # When specifying a known name, (python2 / python3) the module # will also try 'python' as a fallback and use it if the major # version matches - self.init(testdir, ['-Dpython=python2']) - self.build() - self.run_tests() + try: + self.init(testdir, ['-Dpython=python2']) + self.build() + self.run_tests() + except unittest.SkipTest: + # python2 is not necessarily installed on the test machine, + # if it is not, or the python headers can't be found, the test + # will raise MESON_SKIP_TEST, we could check beforehand what version + # of python is available, but it's a bit of a chicken and egg situation, + # as that is the job of the module, so we just ask for forgiveness rather + # than permission. + pass + self.wipe() # The test is configured to error out with MESON_SKIP_TEST |