gh-108794: doctest counts skipped tests by vstinner · Pull Request #108795 · python/cpython
* Add 'skipped' attribute to doctest.TestResults. * Rename private DocTestRunner._name2ft attribute to DocTestRunner._stats. * Use f-string for string formatting. * Add some tests.
When a doctest.TestResults is unpacked with x, y = result, there is no backward incompatible changes. TestResults still only unpacks the first 2 members (failed and attempted).
Example: failed, attempted = result.
I wrote this enhancement while working on #108793 which logs the number of executed tests.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature! A few docs nits:
@AlexWaygood: Would you mind to review the updated PR?
I updated my PR to address your remarks. I also renamed DocTestRunner.skipped to DocTestRunner.skips for consistency with existing attributes. Sadly, DocTestRunner and TestResults have different attribute names.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more minor suggestions:
@AlexWaygood: Oh thanks, I addressed your second review. I also mentioned the addition of the skips attribute in What's New/Changelog entry.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!