Commit 18c93893 authored by Denis Bilenko's avatar Denis Bilenko

testrunner: patch output to replace __main__ with actual test script name

parent df17106d
......@@ -188,6 +188,7 @@ def run_tests(options, args):
test_support.BasicTestRunner = _runner
if os.path.exists(arg):
sys.argv = args
# QQQ this makes tests reported as if they are from __main__ and screws up warnings location
execfile(arg, globals())
else:
test = defaultTestLoader.loadTestsFromName(arg)
......@@ -248,6 +249,11 @@ def run_subprocess(arg, options):
raise
finally:
timeout.cancel()
# QQQ compensating for run_tests' screw up
module_name = arg
if module_name.endswith('.py'):
module_name = module_name[:-3]
output = output.replace(' (__main__.', ' (' + module_name + '.')
return retcode[0], output
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment