Skip to content

Commit

Permalink
Merge pull request web2py#1466 from niphlod/fix/system_tests
Browse files Browse the repository at this point in the history
fix launching system_tests without coverage
  • Loading branch information
mdipierro authored Sep 27, 2016
2 parents 0e4ff55 + 55f929b commit 9e80654
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gluon/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)


Expand Down

0 comments on commit 9e80654

Please sign in to comment.