gh-117225: doctest: only print "and X failed" when non-zero, don't pluralise "1 items" (#117228)

This commit is contained in:
Hugo van Kemenade 2024-03-27 16:46:35 +02:00 committed by GitHub
parent 92397d5ead
commit ce00de4c8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 69 additions and 48 deletions

View file

@ -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