diff options
author | Mats Wichmann <mats@linux.com> | 2019-03-01 16:46:54 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-03-01 17:10:38 (GMT) |
commit | 83c4b8ff692066bf29daa9a6aebf10818a914475 (patch) | |
tree | ec26b4b7a17b95aa512273f627d11f0093d6741d /testing | |
parent | f765b5c4fa6b41de214b243daa6dd3ad6356dfe2 (diff) | |
download | SCons-83c4b8ff692066bf29daa9a6aebf10818a914475.zip SCons-83c4b8ff692066bf29daa9a6aebf10818a914475.tar.gz SCons-83c4b8ff692066bf29daa9a6aebf10818a914475.tar.bz2 |
[WIP] for #3304: drop use of -tt if py3
As noted in issue #3304, the Python flag to error on inconsistent
tabs/spaces has been dropped for Python 3 interpreters; while
CPython still accepts it, silently ignoring it, PyPy3 errors out.
This change adds the flag throughout the testsuite run only if
using a Python2 interpreter.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestRuntest.py | 10 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 4 | ||||
-rw-r--r-- | testing/framework/TestSCons_time.py | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/testing/framework/TestRuntest.py b/testing/framework/TestRuntest.py index 7b3bb52..faf5d60 100644 --- a/testing/framework/TestRuntest.py +++ b/testing/framework/TestRuntest.py @@ -27,6 +27,7 @@ from TestCommon import __all__ __all__.extend([ 'TestRuntest', 'pythonstring', + 'pythonflags', ]) if re.search('\s', python): @@ -34,7 +35,9 @@ if re.search('\s', python): else: pythonstring = python pythonstring = pythonstring.replace('\\', '\\\\') - +pythonflags = '' +if sys.version_info[0] < 3: + pythonflags = ' -tt' failing_test_template = """\ import sys @@ -104,7 +107,10 @@ class TestRuntest(TestCommon): if 'program' not in kw: kw['program'] = 'runtest.py' if 'interpreter' not in kw: - kw['interpreter'] = [python, '-tt'] + kw['interpreter'] = [python,] + if sys.version_info[0] < 3: + kw['interpreter'].append('-tt') + if 'match' not in kw: kw['match'] = match_exact if 'workdir' not in kw: diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 7fe48e8..57b300d 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -247,7 +247,9 @@ class TestSCons(TestCommon): elif not self.external and not os.path.isabs(kw['program']): kw['program'] = os.path.join(self.orig_cwd, kw['program']) if 'interpreter' not in kw and not os.environ.get('SCONS_EXEC'): - kw['interpreter'] = [python, '-tt'] + kw['interpreter'] = [python,] + if sys.version_info[0] < 3: + kw['interpreter'].append('-tt') if 'match' not in kw: kw['match'] = match_exact if 'workdir' not in kw: diff --git a/testing/framework/TestSCons_time.py b/testing/framework/TestSCons_time.py index 6299f51..8260bef 100644 --- a/testing/framework/TestSCons_time.py +++ b/testing/framework/TestSCons_time.py @@ -186,7 +186,9 @@ class TestSCons_time(TestCommon): kw['program'] = p if 'interpreter' not in kw: - kw['interpreter'] = [python, '-tt'] + kw['interpreter'] = [python,] + if sys.version_info[0] < 3: + kw['interpreter'].append('-tt') if 'match' not in kw: kw['match'] = match_exact |