Skip to content

Refresh doctest summary #117225

Closed
Closed
@hugovk

Description

@hugovk

Feature or enhancement

The doctest output looks like this:

Document: howto/ipaddress ------------------------- 1 items passed all tests: 10 tests in default 10 tests in 1 items. 10 passed and 0 failed. Test passed. Document: howto/functional -------------------------- 1 items passed all tests: 50 tests in default 50 tests in 1 items. 50 passed and 0 failed. Test passed. Document: whatsnew/3.2 ---------------------- 1 items passed all tests: 81 tests in default 81 tests in 1 items. 81 passed and 0 failed. Test passed. Document: tutorial/inputoutput ------------------------------ 1 items passed all tests: 4 tests in default 4 tests in 1 items. 4 passed and 0 failed. Test passed. Document: library/configparser ------------------------------ 1 items passed all tests: 82 tests in default 82 tests in 1 items. 82 passed and 0 failed. Test passed. 1 items passed all tests: 1 tests in default (cleanup code) 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/weakref ------------------------- 1 items passed all tests: 31 tests in default 31 tests in 1 items. 31 passed and 0 failed. Test passed. Document: library/multiprocessing.shared_memory ----------------------------------------------- 1 items passed all tests: 79 tests in default 79 tests in 1 items. 79 passed and 0 failed. Test passed. Document: library/base64 ------------------------ 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: howto/sorting ----------------------- 1 items passed all tests: 42 tests in default 42 tests in 1 items. 42 passed and 0 failed. Test passed. Document: whatsnew/2.7 ---------------------- 1 items passed all tests: 39 tests in default 39 tests in 1 items. 39 passed and 0 failed. Test passed. Document: reference/executionmodel ---------------------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: tutorial/floatingpoint -------------------------------- 1 items passed all tests: 35 tests in default 35 tests in 1 items. 35 passed and 0 failed. Test passed. Document: library/binascii -------------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: library/decimal ------------------------- 2 items passed all tests: 66 tests in default 42 tests in newcontext 108 tests in 2 items. 108 passed and 0 failed. Test passed. 2 items passed all tests: 1 tests in default (cleanup code) 1 tests in newcontext (cleanup code) 2 tests in 2 items. 2 passed and 0 failed. Test passed. Document: library/inspect ------------------------- ********************************************************************** File "library/inspect.rst", line 438, in default Failed example: inspect.isasyncgenfunction(agen) Expected: False Got: True ********************************************************************** 1 items had failures: 1 of 35 in default 35 tests in 1 items. 34 passed and 1 failed. ***Test Failed*** 1 failures. Document: library/glob ---------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: library/email.policy ------------------------------ 1 items passed all tests: 10 tests in default 10 tests in 1 items. 10 passed and 0 failed. Test passed. 1 items passed all tests: 1 tests in default (cleanup code) 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/datetime -------------------------- 1 items passed all tests: 36 tests in default 36 tests in 1 items. 36 passed and 0 failed. Test passed. Document: library/fractions --------------------------- 1 items passed all tests: 8 tests in default 8 tests in 1 items. 8 passed and 0 failed. Test passed. Document: reference/datamodel ----------------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: library/functools --------------------------- 1 items passed all tests: 4 tests in default 4 tests in 1 items. 4 passed and 0 failed. Test passed. Document: library/random ------------------------ 1 items passed all tests: 1 tests in import random 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/traceback --------------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: faq/programming ------------------------- 1 items passed all tests: 34 tests in default 34 tests in 1 items. 34 passed and 0 failed. Test passed. Document: library/shlex ----------------------- 1 items passed all tests: 23 tests in default 23 tests in 1 items. 23 passed and 0 failed. Test passed. Document: library/urllib.parse ------------------------------ 1 items passed all tests: 26 tests in default 26 tests in 1 items. 26 passed and 0 failed. Test passed. Document: library/unittest.mock-examples ---------------------------------------- 1 items passed all tests: 200 tests in default 200 tests in 1 items. 200 passed and 0 failed. Test passed. Document: library/collections.abc --------------------------------- 1 items passed all tests: 9 tests in default 9 tests in 1 items. 9 passed and 0 failed. Test passed. Document: library/fnmatch ------------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: library/graphlib -------------------------- 1 items passed all tests: 11 tests in default 11 tests in 1 items. 11 passed and 0 failed. Test passed. Document: library/email.message ------------------------------- 1 items passed all tests: 4 tests in default 4 tests in 1 items. 4 passed and 0 failed. Test passed. Document: library/exceptions ---------------------------- 1 items passed all tests: 11 tests in default 11 tests in 1 items. 11 passed and 0 failed. Test passed. Document: library/unicodedata ----------------------------- 1 items passed all tests: 7 tests in default 7 tests in 1 items. 7 passed and 0 failed. Test passed. Document: library/re -------------------- 1 items passed all tests: 12 tests in default 12 tests in 1 items. 12 passed and 0 failed. Test passed. Document: whatsnew/3.13 ----------------------- 1 items passed all tests: 1 tests in default 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/http.cookies ------------------------------ 1 items passed all tests: 30 tests in default 30 tests in 1 items. 30 passed and 0 failed. Test passed. Document: library/ftplib ------------------------ 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. Document: library/pprint ------------------------ 1 items passed all tests: 16 tests in default 16 tests in 1 items. 16 passed and 0 failed. Test passed. Document: howto/descriptor -------------------------- 1 items passed all tests: 183 tests in default 183 tests in 1 items. 183 passed and 0 failed. Test passed. 1 items passed all tests: 1 tests in default (cleanup code) 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/turtle ------------------------ 1 items passed all tests: 314 tests in default 314 tests in 1 items. 314 passed and 0 failed. Test passed. Document: library/difflib ------------------------- 1 items passed all tests: 43 tests in default 43 tests in 1 items. 43 passed and 0 failed. Test passed. Document: library/math ---------------------- 1 items passed all tests: 8 tests in default 8 tests in 1 items. 8 passed and 0 failed. Test passed. Document: library/pathlib ------------------------- 1 items passed all tests: 5 tests in default 5 tests in 1 items. 5 passed and 0 failed. Test passed. Document: library/unittest.mock ------------------------------- 1 items passed all tests: 462 tests in default 462 tests in 1 items. 462 passed and 0 failed. Test passed. Document: library/email.compat32-message ---------------------------------------- 1 items passed all tests: 3 tests in default 3 tests in 1 items. 3 passed and 0 failed. Test passed. Document: library/copyreg ------------------------- 1 items passed all tests: 7 tests in default 7 tests in 1 items. 7 passed and 0 failed. Test passed. Document: library/getopt ------------------------ 1 items passed all tests: 12 tests in default 12 tests in 1 items. 12 passed and 0 failed. Test passed. Document: reference/simple_stmts -------------------------------- 1 items passed all tests: 1 tests in default 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/typing ------------------------ 1 items passed all tests: 58 tests in default 58 tests in 1 items. 58 passed and 0 failed. Test passed. Document: whatsnew/3.8 ---------------------- 1 items passed all tests: 6 tests in default 6 tests in 1 items. 6 passed and 0 failed. Test passed. Document: library/argparse -------------------------- 1 items passed all tests: 11 tests in default 11 tests in 1 items. 11 passed and 0 failed. Test passed. Document: library/stdtypes -------------------------- 1 items passed all tests: 59 tests in default 59 tests in 1 items. 59 passed and 0 failed. Test passed. Document: library/secrets ------------------------- 1 items passed all tests: 7 tests in default 7 tests in 1 items. 7 passed and 0 failed. Test passed. Document: tutorial/introduction ------------------------------- 1 items passed all tests: 3 tests in default 3 tests in 1 items. 3 passed and 0 failed. Test passed. Document: library/codecs ------------------------ 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. Document: library/statistics ---------------------------- 1 items passed all tests: 117 tests in default 117 tests in 1 items. 117 passed and 0 failed. Test passed. Document: library/enum ---------------------- 1 items passed all tests: 19 tests in default 19 tests in 1 items. 19 passed and 0 failed. Test passed. Document: library/multiprocessing --------------------------------- 1 items passed all tests: 48 tests in default 48 tests in 1 items. 48 passed and 0 failed. Test passed. Document: library/ast --------------------- 1 items passed all tests: 74 tests in default 74 tests in 1 items. 74 passed and 0 failed. Test passed. Document: library/doctest ------------------------- 1 items passed all tests: 9 tests in default 9 tests in 1 items. 9 passed and 0 failed. Test passed. Document: library/email.iterators --------------------------------- 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. 1 items passed all tests: 1 tests in default (cleanup code) 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/bz2 --------------------- 1 items passed all tests: 17 tests in default 17 tests in 1 items. 17 passed and 0 failed. Test passed. 1 items passed all tests: 1 tests in default (cleanup code) 1 tests in 1 items. 1 passed and 0 failed. Test passed. Document: library/functions --------------------------- 1 items passed all tests: 29 tests in default 29 tests in 1 items. 29 passed and 0 failed. Test passed. Document: library/struct ------------------------ 1 items passed all tests: 4 tests in default 4 tests in 1 items. 4 passed and 0 failed. Test passed. Document: library/time ---------------------- 1 items passed all tests: 2 tests in default 2 tests in 1 items. 2 passed and 0 failed. Test passed. Document: library/itertools --------------------------- 1 items passed all tests: 268 tests in default 268 tests in 1 items. 268 passed and 0 failed. Test passed. Document: library/ipaddress --------------------------- 1 items passed all tests: 50 tests in default 50 tests in 1 items. 50 passed and 0 failed. Test passed. Document: library/sqlite3 ------------------------- 4 items passed all tests: 71 tests in default 3 tests in sqlite3.cursor 3 tests in sqlite3.limits 8 tests in sqlite3.trace 85 tests in 4 items. 85 passed and 0 failed. Test passed. Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Document: library/collections ----------------------------- 1 items passed all tests: 121 tests in default 121 tests in 1 items. 121 passed and 0 failed. Test passed. Document: library/reprlib ------------------------- 2 items passed all tests: 7 tests in default 8 tests in indent 15 tests in 2 items. 15 passed and 0 failed. Test passed. Document: library/dis --------------------- 1 items passed all tests: 3 tests in default 3 tests in 1 items. 3 passed and 0 failed. Test passed. Exception ignored in sys.unraisablehook: <function debug at 0x7fbdb071bc50> Traceback (most recent call last): File "<doctest sqlite3.trace[4]>", line 2, in debug AttributeError: 'sqlite3.Connection' object has no attribute '__name__' Document: library/operator -------------------------- 1 items passed all tests: 15 tests in default 15 tests in 1 items. 15 passed and 0 failed. Test passed. Document: whatsnew/3.12 ----------------------- 1 items passed all tests: 12 tests in default 12 tests in 1 items. 12 passed and 0 failed. Test passed. Document: library/hashlib ------------------------- 1 items passed all tests: 58 tests in default 58 tests in 1 items. 58 passed and 0 failed. Test passed. Document: library/ssl --------------------- 2 items passed all tests: 3 tests in default 5 tests in newcontext 8 tests in 2 items. 8 passed and 0 failed. Test passed. Document: library/ctypes ------------------------ 1 items passed all tests: 6 tests in default 6 tests in 1 items. 6 passed and 0 failed. Test passed. Doctest summary =============== 3222 tests 1 failure in tests 0 failures in setup code 0 failures in cleanup code 

When you know a doctest run has failed on the CI, you might search the logs for "failed" to find it. But when 81 of 84 results are for "0 failed" it's not so helpful.

  • There's no need to print "0 failed" in the logs, we should only print that when there's 1+ failed.

  • There are lots of logs with "1 items" or "1 tests". Let's skip the "s" when only one.

  • And now we have colour handling in 3.13, it would also help to add some colour to the output.

I'll open some PRs.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions