Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Unified Diff: Lib/test/test_zipimport_support.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_zipimport.py ('k') | Lib/test/threaded_import_hangers.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_zipimport_support.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/test/test_zipimport_support.py Mon Jul 25 09:47:18 2011 -0400
@@ -33,19 +33,26 @@
def _run_object_doctest(obj, module):
- finder = doctest.DocTestFinder(verbose=verbose, recurse=False)
- runner = doctest.DocTestRunner(verbose=verbose)
- # Use the object's fully qualified name if it has one
- # Otherwise, use the module's name
+ # 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:
- name = "%s.%s" % (obj.__module__, obj.__name__)
- except AttributeError:
- name = module.__name__
- for example in finder.find(obj, name, module):
- runner.run(example)
- f, t = runner.failures, runner.tries
- if f:
- raise test.support.TestFailed("%d of %d doctests failed" % (f, t))
+ finder = doctest.DocTestFinder(verbose=verbose, recurse=False)
+ runner = doctest.DocTestRunner(verbose=verbose)
+ # Use the object's fully qualified name if it has one
+ # Otherwise, use the module's name
+ try:
+ name = "%s.%s" % (obj.__module__, obj.__name__)
+ except AttributeError:
+ name = module.__name__
+ for example in finder.find(obj, name, module):
+ runner.run(example)
+ f, t = runner.failures, runner.tries
+ if f:
+ raise test.support.TestFailed("%d of %d doctests failed" % (f, t))
+ finally:
+ sys.stdout = save_stdout
if verbose:
print ('doctest (%s) ... %d tests with zero failures' % (module.__name__, t))
return f, t
« no previous file with comments | « Lib/test/test_zipimport.py ('k') | Lib/test/threaded_import_hangers.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+