mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder`` has been changed to sort the list of tests it returns.
This commit is contained in:
parent
00decd7835
commit
6f6814706e
3 changed files with 11 additions and 7 deletions
|
|
@ -821,6 +821,11 @@ class DocTestFinder:
|
|||
# Recursively expore `obj`, extracting DocTests.
|
||||
tests = []
|
||||
self._find(tests, obj, name, module, source_lines, globs, {})
|
||||
# Sort the tests by alpha order of names, for consistency in
|
||||
# verbose-mode output. This was a feature of doctest in Pythons
|
||||
# <= 2.3 that got lost by accident in 2.4. It was repaired in
|
||||
# 2.4.4 and 2.5.
|
||||
tests.sort()
|
||||
return tests
|
||||
|
||||
def _from_module(self, module, object):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue