GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-108794: doctest counts skipped tests by vstinner · Pull Request #108795 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 2, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Add 'skipped' attribute to doctest.TestResults.
  • Rename private DocTestRunner._name2ft attribute to DocTestRunner._stats.
  • Use f-string for string formatting.
  • Add some tests.
  • Issue: doctest: count the number of skipped tests #108794

📚 Documentation preview 📚: https://cpython-previews--108795.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-108794: doctest counts skipped tests
f611d19
* Add 'skipped' attribute to doctest.TestResults.
* Rename private DocTestRunner._name2ft attribute
  to DocTestRunner._stats.
* Use f-string for string formatting.
* Add some tests.
@bedevere-bot bedevere-bot mentioned this pull request Sep 2, 2023
doctest: count the number of skipped tests #108794
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Sep 2, 2023
@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

I wrote this enhancement while working on #108793 which logs the number of executed tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood reviewed Sep 2, 2023
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/doctest.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/doctest.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/doctest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/doctest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/doctest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/doctest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood reviewed Sep 2, 2023
View reviewed changes
Comment thread Lib/doctest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits September 2, 2023 13:15
@vstinner
Address Alex Waygood's review
06805f2
@vstinner
Rename DocTestRunner.skipped to skips
e2fac23
Document also DocTestRunner API for statistics, document its
attributes.
@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

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

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

cc @tim-one

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood reviewed Sep 2, 2023
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/doctest.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/doctest.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Tests/2023-09-02-05-13-38.gh-issue-108794.tGHXBt.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
Address Alex's suggestion
06f11af
@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

@AlexWaygood: Oh thanks, I addressed your second review. I also mentioned the addition of the skips attribute in What's New/Changelog entry.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood approved these changes Sep 2, 2023
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Sep 2, 2023
@vstinner @AlexWaygood
Update Doc/whatsnew/3.13.rst
a46fcce
Co-authored-by: Alex Waygood <[email protected]>
@vstinner
vstinner merged commit 4f9b706 into python:main Sep 2, 2023
@vstinner
vstinner deleted the doctest_skipped branch September 2, 2023 14:42
@bedevere-bot bedevere-bot removed the awaiting merge label Sep 2, 2023
@vstinner

vstinner commented Sep 2, 2023

Copy link
Copy Markdown
Member Author

Thanks for the great review @AlexWaygood! I merged my PR.

AlexWaygood reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @AlexWaygood @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.