mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-117225: doctest: only print "and X failed" when non-zero, don't pluralise "1 items" (#117228)
This commit is contained in:
parent
92397d5ead
commit
ce00de4c8c
4 changed files with 69 additions and 48 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue