PASSED test passed
"""
- support.verbose = verbose # Tell tests to be moderately quiet
if use_resources is not None:
support.use_resources = use_resources
+ use_timeout = (timeout is not None)
+ if use_timeout:
+ faulthandler.dump_tracebacks_later(timeout, exit=True)
try:
- result = runtest_inner(test, verbose, quiet, huntrleaks, debug)
- if result[0] == FAILED and rerun_failed:
- cleanup_test_droppings(test, verbose)
- sys.stdout.flush()
- sys.stderr.flush()
- print("Re-running test {} in verbose mode".format(test))
- runtest(test, True, quiet, huntrleaks, debug, timeout=timeout)
+ if rerun_failed:
+ support.verbose = True
+ orig_stderr = sys.stderr
+ with support.captured_stdout() as stream:
+ try:
+ sys.stderr = stream
+ result = runtest_inner(test, verbose, quiet, huntrleaks,
+ debug, display_failure=False)
+ if result[0] == FAILED:
+ output = stream.getvalue()
+ orig_stderr.write(output)
+ orig_stderr.flush()
+ finally:
+ sys.stderr = orig_stderr
+ else:
+ support.verbose = verbose # Tell tests to be moderately quiet
+ result = runtest_inner(test, verbose, quiet, huntrleaks, debug,
+ display_failure=not verbose)
return result
finally:
+ if use_timeout:
+ faulthandler.cancel_dump_tracebacks_later()
cleanup_test_droppings(test, verbose)
# Unit tests are supposed to leave the execution environment unchanged
return False
- def runtest_inner(test, verbose, quiet, huntrleaks=False, debug=False):
+ def runtest_inner(test, verbose, quiet,
+ huntrleaks=False, debug=False, display_failure=True):
support.unload(test)
- if verbose:
- capture_stdout = None
- else:
- capture_stdout = io.StringIO()
test_time = 0.0
refleak = False # True if the test leaked references.
Tests
-----
++- Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
++ the output and displays it on failure instead. regrtest -v doesn't print the
++ error twice anymore if there is only one error.
++
+- Issue #12141: Install copies of template C module file so that
+ test_build_ext of test_distutils and test_command_build_ext of
+ test_packaging are no longer silently skipped when
+ run outside of a build directory.
+
+- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
+ Patch by Garrett Cooper.
+
+- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
+ 2.8 + on Mac OS X. (Patch by Ronald Oussoren)
+
+- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
+ iso2022_kr).
+
+- Issue #12180: Fixed a few remaining errors in test_packaging when no
+ threading.
+
+- Issue #12120, #12119: skip a test in packaging and distutils
+ if sys.dont_write_bytecode is set to True.
+
+- Issue #12096: Fix a race condition in test_threading.test_waitfor(). Patch
+ written by Charles-François Natali.
+
+- Issue #11614: import __hello__ prints "Hello World!". Patch written by
+ Andreas Stührk.
+
+- Issue #5723: Improve json tests to be executed with and without accelerations.
+
+- Issue #12041: Make test_wait3 more robust.
+
- Issue #11873: Change regex in test_compileall to fix occasional failures when
when the randomly generated temporary path happened to match the regex.