Commit 8d94c0ab authored by Steve Dower's avatar Steve Dower

Suppress assert dialogs in test_os

parent 83f8d90b
...@@ -1199,8 +1199,10 @@ class URandomFDTests(unittest.TestCase): ...@@ -1199,8 +1199,10 @@ class URandomFDTests(unittest.TestCase):
code = """if 1: code = """if 1:
import os import os
import sys import sys
import test.support
os.urandom(4) os.urandom(4)
os.closerange(3, 256) with test.support.SuppressCrashReport():
os.closerange(3, 256)
sys.stdout.buffer.write(os.urandom(4)) sys.stdout.buffer.write(os.urandom(4))
""" """
rc, out, err = assert_python_ok('-Sc', code) rc, out, err = assert_python_ok('-Sc', code)
...@@ -1214,16 +1216,18 @@ class URandomFDTests(unittest.TestCase): ...@@ -1214,16 +1216,18 @@ class URandomFDTests(unittest.TestCase):
code = """if 1: code = """if 1:
import os import os
import sys import sys
import test.support
os.urandom(4) os.urandom(4)
for fd in range(3, 256): with test.support.SuppressCrashReport():
try: for fd in range(3, 256):
os.close(fd) try:
except OSError: os.close(fd)
pass except OSError:
else: pass
# Found the urandom fd (XXX hopefully) else:
break # Found the urandom fd (XXX hopefully)
os.closerange(3, 256) break
os.closerange(3, 256)
with open({TESTFN!r}, 'rb') as f: with open({TESTFN!r}, 'rb') as f:
os.dup2(f.fileno(), fd) os.dup2(f.fileno(), fd)
sys.stdout.buffer.write(os.urandom(4)) sys.stdout.buffer.write(os.urandom(4))
......
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