diff options
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r-- | Lib/test/support.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index 25aab2e..83ea6c1 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -1230,16 +1230,9 @@ def run_doctest(module, verbosity=None): else: verbosity = None - # Direct doctest output (normally just errors) to real stdout; doctest - # output shouldn't be compared by regrtest. - save_stdout = sys.stdout - sys.stdout = get_original_stdout() - try: - f, t = doctest.testmod(module, verbose=verbosity) - if f: - raise TestFailed("%d of %d doctests failed" % (f, t)) - finally: - sys.stdout = save_stdout + f, t = doctest.testmod(module, verbose=verbosity) + if f: + raise TestFailed("%d of %d doctests failed" % (f, t)) if verbose: print('doctest (%s) ... %d tests with zero failures' % (module.__name__, t)) |