mirror of
https://github.com/python/cpython.git
synced 2025-08-10 20:08:47 +00:00
Issue #8533: Write tracebacks and failed tests to sys.stderr instead of
sys.stdout to avoid UnicodeEncodeError (use backslashreplace error handler)
This commit is contained in:
parent
70d8a86ea0
commit
0d80a5874a
3 changed files with 6 additions and 3 deletions
|
@ -939,8 +939,8 @@ def runtest_inner(test, verbose, quiet,
|
||||||
print("test", test, "crashed --", str(type) + ":", value)
|
print("test", test, "crashed --", str(type) + ":", value)
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if verbose or debug:
|
if verbose or debug:
|
||||||
traceback.print_exc(file=sys.stdout)
|
traceback.print_exc(file=sys.stderr)
|
||||||
sys.stdout.flush()
|
sys.stderr.flush()
|
||||||
return FAILED, test_time
|
return FAILED, test_time
|
||||||
else:
|
else:
|
||||||
if refleak:
|
if refleak:
|
||||||
|
|
|
@ -1020,7 +1020,7 @@ def check_impl_detail(**guards):
|
||||||
def _run_suite(suite):
|
def _run_suite(suite):
|
||||||
"""Run tests from a unittest.TestSuite-derived class."""
|
"""Run tests from a unittest.TestSuite-derived class."""
|
||||||
if verbose:
|
if verbose:
|
||||||
runner = unittest.TextTestRunner(sys.stdout, verbosity=2)
|
runner = unittest.TextTestRunner(sys.stderr, verbosity=2)
|
||||||
else:
|
else:
|
||||||
runner = BasicTestRunner()
|
runner = BasicTestRunner()
|
||||||
|
|
||||||
|
|
|
@ -1198,6 +1198,9 @@ Documentation
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #8533: Write tracebacks and failed tests to sys.stderr instead of
|
||||||
|
sys.stdout to avoid UnicodeEncodeError (use backslashreplace error handler)
|
||||||
|
|
||||||
- Issue #8576: Remove use of find_unused_port() in test_smtplib and
|
- Issue #8576: Remove use of find_unused_port() in test_smtplib and
|
||||||
test_multiprocessing. Patch by Paul Moore.
|
test_multiprocessing. Patch by Paul Moore.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue