diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-03 19:40:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-03 19:40:21 (GMT) |
commit | 20d2118248f9313a9b77bb4d299252da7fc7fa2f (patch) | |
tree | d62afb5e6c96a68cbb6a25a6cb06f19ce665c3d2 /Lib | |
parent | 33c30131db0249dec166fcbe22cd9152b405e170 (diff) | |
download | cpython-20d2118248f9313a9b77bb4d299252da7fc7fa2f.zip cpython-20d2118248f9313a9b77bb4d299252da7fc7fa2f.tar.gz cpython-20d2118248f9313a9b77bb4d299252da7fc7fa2f.tar.bz2 |
Issue #25306: Try to fix test_huntrleaks_fd_leak() on Windows
Issue #25306: Disable popup and logs to stderr on assertion failures in MSCRT.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_regrtest.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index edbb4b0..2e33555 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -643,14 +643,24 @@ class ArgsTestCase(BaseTestCase): self.check_executed_tests(output, [test]*3, failed=test) @unittest.skipUnless(Py_DEBUG, 'need a debug build') - # Issue #25306: the test hangs sometimes on Windows - @unittest.skipIf(sys.platform == 'win32', 'test broken on Windows') def test_huntrleaks_fd_leak(self): # test --huntrleaks for file descriptor leak code = textwrap.dedent(""" import os import unittest + # Issue #25306: Disable popups and logs to stderr on assertion + # failures in MSCRT + try: + import msvcrt + msvcrt.CrtSetReportMode + except (ImportError, AttributeError): + # no Windows, o release build + pass + else: + for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]: + msvcrt.CrtSetReportMode(m, 0) + class FDLeakTest(unittest.TestCase): def test_leak(self): fd = os.open(__file__, os.O_RDONLY) |