Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit fa99ff7

Browse files
committed
merge heads
2 parents 9cecd17 + 2c18776 commit fa99ff7

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pypy/test_all.py

+17
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,21 @@
2727
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
2828
import pytest
2929
import pytest_cov
30+
if sys.platform == 'win32':
31+
#Try to avoid opeing a dialog box if one of the tests causes a system error
32+
# We do this in runner.py, but buildbots run twisted which ruins inheritance
33+
# in windows subprocesses.
34+
import ctypes
35+
winapi = ctypes.windll.kernel32
36+
SetErrorMode = winapi.SetErrorMode
37+
SetErrorMode.argtypes=[ctypes.c_int]
38+
39+
SEM_FAILCRITICALERRORS = 1
40+
SEM_NOGPFAULTERRORBOX = 2
41+
SEM_NOOPENFILEERRORBOX = 0x8000
42+
flags = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX
43+
#Since there is no GetErrorMode, do a double Set
44+
old_mode = SetErrorMode(flags)
45+
SetErrorMode(old_mode | flags)
46+
3047
sys.exit(pytest.main(plugins=[pytest_cov]))

testrunner/runner.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ def main(args):
407407
run_param.dry_run = opts.dry_run
408408

409409
if run_param.dry_run:
410-
print >>out, run_param.__dict__
410+
print >>out, '\n'.join([str((k, getattr(run_param, k))) \
411+
for k in dir(run_param) if k[:2] != '__'])
411412

412413
res = execute_tests(run_param, testdirs, logfile, out)
413414

0 commit comments

Comments
 (0)