mirror of
https://github.com/python/cpython.git
synced 2025-09-14 12:46:49 +00:00
(merge 3.2) Issue #12400: test_zipimport_support doesn't restore original
sys.stdout anymore regrtest doesn't check that a test doesn't output anything anymore.
This commit is contained in:
commit
e6db1440d8
1 changed files with 12 additions and 19 deletions
|
@ -33,11 +33,6 @@ from test import test_doctest, sample_doctest
|
||||||
|
|
||||||
|
|
||||||
def _run_object_doctest(obj, module):
|
def _run_object_doctest(obj, module):
|
||||||
# Direct doctest output (normally just errors) to real stdout; doctest
|
|
||||||
# output shouldn't be compared by regrtest.
|
|
||||||
save_stdout = sys.stdout
|
|
||||||
sys.stdout = test.support.get_original_stdout()
|
|
||||||
try:
|
|
||||||
finder = doctest.DocTestFinder(verbose=verbose, recurse=False)
|
finder = doctest.DocTestFinder(verbose=verbose, recurse=False)
|
||||||
runner = doctest.DocTestRunner(verbose=verbose)
|
runner = doctest.DocTestRunner(verbose=verbose)
|
||||||
# Use the object's fully qualified name if it has one
|
# Use the object's fully qualified name if it has one
|
||||||
|
@ -51,8 +46,6 @@ def _run_object_doctest(obj, module):
|
||||||
f, t = runner.failures, runner.tries
|
f, t = runner.failures, runner.tries
|
||||||
if f:
|
if f:
|
||||||
raise test.support.TestFailed("%d of %d doctests failed" % (f, t))
|
raise test.support.TestFailed("%d of %d doctests failed" % (f, t))
|
||||||
finally:
|
|
||||||
sys.stdout = save_stdout
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print ('doctest (%s) ... %d tests with zero failures' % (module.__name__, t))
|
print ('doctest (%s) ... %d tests with zero failures' % (module.__name__, t))
|
||||||
return f, t
|
return f, t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue