diff options
author | Jose <jose@zeroc.com> | 2021-01-19 00:08:00 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2021-01-19 00:08:00 +0100 |
commit | d3fee57d4a4b6f8903637350c895049e46666798 (patch) | |
tree | c8f072eefe0343b7dd3b15424504e9420964c8f7 | |
parent | Update to MSbuild builder 5.0.6 (diff) | |
download | ice-d3fee57d4a4b6f8903637350c895049e46666798.tar.bz2 ice-d3fee57d4a4b6f8903637350c895049e46666798.tar.xz ice-d3fee57d4a4b6f8903637350c895049e46666798.zip |
Check the python version of the interpreter running the tests
-rw-r--r-- | python/test/Ice/asyncio/test.py | 10 | ||||
-rw-r--r-- | scripts/Util.py | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/python/test/Ice/asyncio/test.py b/python/test/Ice/asyncio/test.py index 5e4ba559841..8df759f8107 100644 --- a/python/test/Ice/asyncio/test.py +++ b/python/test/Ice/asyncio/test.py @@ -3,7 +3,15 @@ # Copyright (c) ZeroC, Inc. All rights reserved. # + # This test requires asyncio methods which are only available with Python 3.7 +# We want to check the version of the python interpreter used to run the tests +# not the version of the python interpreter running this script see --python option + +version = subprocess.check_output([currentConfig.python, + "-c", + "import sys; print(f\"{sys.version_info[0]}.{sys.version_info[1]}\")"], text=True) +version = tuple(int(num) for num in version.split(".")) -if sys.version_info >= (3, 7): +if version >= (3, 7): TestSuite(__name__) diff --git a/scripts/Util.py b/scripts/Util.py index 9f2f9e32f89..7497cee2096 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -892,6 +892,8 @@ class Mapping(object): def loadTestSuites(self, tests, config, filters=[], rfilters=[]): global currentMapping currentMapping = self + global currentConfig + currentConfig = config try: origsyspath = sys.path prefix = os.path.commonprefix([toplevel, self.component.getScriptDir()]) |