From 55f929bab4a30146d9ed714f0067d6668dc280d5 Mon Sep 17 00:00:00 2001 From: niphlod Date: Fri, 23 Sep 2016 20:52:30 +0200 Subject: [PATCH] fix launching system_tests without coverage --- gluon/widget.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gluon/widget.py b/gluon/widget.py index af3b76892..131bfc3f6 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -55,8 +55,11 @@ def run_system_tests(options): """ import subprocess major_version = sys.version_info[0] - minor_version = sys.version_info[1] call_args = [sys.executable, '-m', 'unittest', '-v', 'gluon.tests'] + if major_version == 2: + sys.stderr.write("Python 2.7\n") + else: + sys.stderr.write("Experimental Python 3.x.\n") if options.with_coverage: has_coverage = False coverage_exec = 'coverage2' if major_version == 2 else 'coverage3' @@ -70,14 +73,12 @@ def run_system_tests(options): coverage_config_file) call_args = [coverage_exec, 'run', '--rcfile=%s' % coverage_config, '-m', 'unittest', '-v', 'gluon.tests'] - if major_version == 2: - sys.stderr.write("Python 2.7\n") - else: - sys.stderr.write("Experimental Python 3.x.\n") if has_coverage: ret = subprocess.call(call_args) else: ret = 256 + else: + ret = subprocess.call(call_args) sys.exit(ret and 1)