]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
t/python-virtualenv.sh: Skip when versions don’t match
authorZack Weinberg <zackw@panix.com>
Sat, 12 Sep 2020 13:51:07 +0000 (09:51 -0400)
committerZack Weinberg <zackw@panix.com>
Sat, 12 Sep 2020 13:51:07 +0000 (09:51 -0400)
On some operating systems ‘python’ is Python 2.x but ‘virtualenv -ppython’
will create a virtualenv that uses Python 3.x.  This is a bug, but it’s
not *automake’s* bug, and should not cause t/python-virtualenv.sh to fail.
Skip the test, instead of failing it, when the inner=outer version check
fails.

(This also has nothing to do with the main goal of this patchset, it just
annoyed me while I was testing.)

* t/python-virtualenv.sh: Skip test, rather than failing it, when
  $py_version_pre != $py_version_post.

t/python-virtualenv.sh

index 6f4e0c07c2ec4831e1277091bd4390f8064a1fa8..05df22b7c874c95328b19859c040b58775de149d 100644 (file)
@@ -39,7 +39,8 @@ fi
 py_version_post=$(python -V)
 
 # Sanity check.
-test "$py_version_pre" = "$py_version_post"
+test "$py_version_pre" = "$py_version_post" \
+  || skip_ "virtualenv $py_version_post != $py_version_pre"
 
 cwd=$(pwd) || fatal_ "getting current working directory"
 py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))')