Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctest: count the number of skipped tests #108794

Closed
vstinner opened this issue Sep 2, 2023 · 2 comments
Closed

doctest: count the number of skipped tests #108794

vstinner opened this issue Sep 2, 2023 · 2 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

vstinner commented Sep 2, 2023

Feature or enhancement

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Proposal:

Currently, doctest only counts the number of failured and attempted tests, not the number of skipped tests.

Linked PRs

@vstinner vstinner added the type-feature A feature request or enhancement label Sep 2, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Sep 2, 2023
* Add 'skipped' attribute to doctest.TestResults.
* Rename private DocTestRunner._name2ft attribute
  to DocTestRunner._stats.
* Use f-string for string formatting.
* Add some tests.
@AlexWaygood AlexWaygood added the stdlib Python modules in the Lib dir label Sep 2, 2023
vstinner added a commit that referenced this issue Sep 2, 2023
* Add 'skipped' attribute to TestResults.
* Add 'skips' attribute to DocTestRunner.
* Rename private DocTestRunner._name2ft attribute
  to DocTestRunner._stats.
* Use f-string for string formatting.
* Add some tests.
* Document DocTestRunner attributes and its API for statistics.
* Document TestResults class.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@serhiy-storchaka
Copy link
Member

See also #108885.

Different examples in a doctest are not like separate test cases. They are not independent, they run in the specific order, and they cannot be conditionally skipped by CLI options. They are more like sub-tests.

@vstinner
Copy link
Member Author

vstinner commented Sep 4, 2023

The feature was implemented in 4f9b706. I close the issue.

See also #108885. Different examples in a doctest are not like separate test cases. They are not independent, they run in the specific order, and they cannot be conditionally skipped by CLI options. They are more like sub-tests.

Ok, I will have a look.

@vstinner vstinner closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants