diff options
author | Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> | 2024-03-27 14:46:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-27 14:46:35 (GMT) |
commit | ce00de4c8cd39816f992e749c1074487d93abe9d (patch) | |
tree | f7d4606de7b2f01311bd43aa955f5f89981277b2 /Doc | |
parent | 92397d5ead38dde4154e70d00f24973bcf2a925a (diff) | |
download | cpython-ce00de4c8cd39816f992e749c1074487d93abe9d.zip cpython-ce00de4c8cd39816f992e749c1074487d93abe9d.tar.gz cpython-ce00de4c8cd39816f992e749c1074487d93abe9d.tar.bz2 |
gh-117225: doctest: only print "and X failed" when non-zero, don't pluralise "1 items" (#117228)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/doctest.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 835a3a7..1357581 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -123,10 +123,10 @@ And so on, eventually ending with: OverflowError: n too large ok 2 items passed all tests: - 1 tests in __main__ - 8 tests in __main__.factorial - 9 tests in 2 items. - 9 passed and 0 failed. + 1 test in __main__ + 6 tests in __main__.factorial + 7 tests in 2 items. + 7 passed. Test passed. $ @@ -1933,7 +1933,7 @@ such a test runner:: optionflags=flags) else: fail, total = doctest.testmod(optionflags=flags) - print("{} failures out of {} tests".format(fail, total)) + print(f"{fail} failures out of {total} tests") .. rubric:: Footnotes |