mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
SF bug [#467336] doctest failures w/ new-style classes.
Taught doctest about static methods, class methods, and property docstrings in new-style classes. As for inspect.py/pydoc.py before it, the new stuff needed didn't really fit into the old architecture (but was less of a strain to force-fit here). New-style class docstrings still aren't found, but that's the subject of a different bug and I want to fix that right instead of hacking around it in doctest.
This commit is contained in:
parent
f49a91340a
commit
17111f3b24
4 changed files with 167 additions and 8 deletions
|
@ -176,7 +176,7 @@ def run_unittest(testclass):
|
|||
# doctest driver.
|
||||
|
||||
def run_doctest(module, verbosity=None):
|
||||
"""Run doctest on the given module.
|
||||
"""Run doctest on the given module. Return (#failures, #tests).
|
||||
|
||||
If optional argument verbosity is not specified (or is None), pass
|
||||
test_support's belief about verbosity on to doctest. Else doctest's
|
||||
|
@ -198,5 +198,6 @@ def run_doctest(module, verbosity=None):
|
|||
f, t = doctest.testmod(module, verbose=verbosity)
|
||||
if f:
|
||||
raise TestFailed("%d of %d doctests failed" % (f, t))
|
||||
return f, t
|
||||
finally:
|
||||
sys.stdout = save_stdout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue