diff options
author | Tim Peters <tim.peters@gmail.com> | 2006-07-27 23:44:37 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2006-07-27 23:44:37 (GMT) |
commit | 6f6814706ea8158ae298244d1e127a8181f22479 (patch) | |
tree | bfe156390e6094f3df5b28ede148ed2e47c45fba /Lib/doctest.py | |
parent | 00decd7835f0c2488451cedc345f2fb0650378b5 (diff) | |
download | cpython-6f6814706ea8158ae298244d1e127a8181f22479.zip cpython-6f6814706ea8158ae298244d1e127a8181f22479.tar.gz cpython-6f6814706ea8158ae298244d1e127a8181f22479.tar.bz2 |
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.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r-- | Lib/doctest.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 1560a18..fe734b3 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -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): |