diff --git a/scripts/gen_individual_importing_tests.py b/scripts/gen_individual_importing_tests.py index a68df84b..7706703a 100644 --- a/scripts/gen_individual_importing_tests.py +++ b/scripts/gen_individual_importing_tests.py @@ -1,10 +1,14 @@ #!/usr/bin/env python # Written by Shlomi Fish, under the MIT Expat License. +import os import os.path +import re from sys import platform IS_MAC = (platform == "darwin") +PY_VERS = ([] if re.search("\\bSKIP_PY2\\b", + os.getenv('TEST_TAGS', '')) else [2])+[3] for module_name in \ [ 'pysollib.acard', @@ -204,7 +208,7 @@ for module_name in \ 'pysollib.wizardutil', ]: is_gtk = ("gtk" in module_name) - for ver in [2, 3]: + for ver in PY_VERS: if ((not is_gtk) or (ver == 2 and (not IS_MAC))): def fmt(s): return s % {'module_name': module_name, 'ver': ver} @@ -216,7 +220,7 @@ import %(module_name)s print('ok 1 - imported') ''')) -for ver in [2, 3]: +for ver in PY_VERS: for mod in [ 'pysol_tests.acard_unit', 'pysol_tests.hint',