diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-03-08 05:25:54 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-03-08 05:25:54 (GMT) |
commit | d5a0be6fc065186c93b781ba6d6308bf1414fb0d (patch) | |
tree | a70d31604410c0082648a7ade8db239d2e982bc6 /Lib | |
parent | 79938f22efb3414fb2fbfdc0ae81b908774a59b1 (diff) | |
download | cpython-d5a0be6fc065186c93b781ba6d6308bf1414fb0d.zip cpython-d5a0be6fc065186c93b781ba6d6308bf1414fb0d.tar.gz cpython-d5a0be6fc065186c93b781ba6d6308bf1414fb0d.tar.bz2 |
Suppress assert dialogs in test_os
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_os.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index e5996c4..f0b98e7 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1199,8 +1199,10 @@ class URandomFDTests(unittest.TestCase): code = """if 1: import os import sys + import test.support os.urandom(4) - os.closerange(3, 256) + with test.support.SuppressCrashReport(): + os.closerange(3, 256) sys.stdout.buffer.write(os.urandom(4)) """ rc, out, err = assert_python_ok('-Sc', code) @@ -1214,16 +1216,18 @@ class URandomFDTests(unittest.TestCase): code = """if 1: import os import sys + import test.support os.urandom(4) - for fd in range(3, 256): - try: - os.close(fd) - except OSError: - pass - else: - # Found the urandom fd (XXX hopefully) - break - os.closerange(3, 256) + with test.support.SuppressCrashReport(): + for fd in range(3, 256): + try: + os.close(fd) + except OSError: + pass + else: + # Found the urandom fd (XXX hopefully) + break + os.closerange(3, 256) with open({TESTFN!r}, 'rb') as f: os.dup2(f.fileno(), fd) sys.stdout.buffer.write(os.urandom(4)) |