Skip to content

gh-43657: Add support for custom test case and runner in both DocTestSuite and DocFileSuite #133203

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mth4saurabh
Copy link

@mth4saurabh mth4saurabh commented Apr 30, 2025

allow users to extend the doctest functionality by providing their own test case and runner implementations, default behavior of DocTestSuite and DocFileSuite has not been changed

  • Added new parameters to DocTestSuite and DocFileSuite:
    • test_case: Optional parameter to specify a custom DocTestCase/DocFileCase class
    • runner: Optional parameter to specify a custom DocTestRunner class
  • Added test cases for custom test case and runner classes
  • Updated documentation in Doc/library/doctest.rst to reflect these changes

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

@bedevere-app
Copy link

bedevere-app bot commented Apr 30, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Apr 30, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@mth4saurabh mth4saurabh force-pushed the gh-43657-pass-test-case-runner-doctest branch 4 times, most recently from 6040838 to e39d8aa Compare April 30, 2025 13:17
@mth4saurabh mth4saurabh force-pushed the gh-43657-pass-test-case-runner-doctest branch from e39d8aa to b4fe2a2 Compare April 30, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant