-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Feature: skip doctests conditionally #5307
Feature: skip doctests conditionally #5307
Conversation
This option allows conditional skipping of doctests.
Codecov Report
@@ Coverage Diff @@
## master #5307 +/- ##
==========================================
+ Coverage 82.21% 82.24% +0.02%
==========================================
Files 296 296
Lines 39346 39367 +21
Branches 6058 6063 +5
==========================================
+ Hits 32348 32376 +28
+ Misses 5669 5663 -6
+ Partials 1329 1328 -1
Continue to review full report at Codecov.
|
…p/cleanup Ensure that `doctest_global_setup` and `doctest_global_cleanup` are executed before and after evaluating each `:skipif:` option.
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.
Perfect! LGTM!
Merged. |
Thank you @tk0miya, I'm really happy to get this feature in. And the experience of contributing to Sphinx was one of the best I've had with any Open Source project. Great work guys! |
I forgot to update `AUTHORS` in sphinx-doc#5307.
Is it somehow possible to add the Example:
How can I skip this test conditionally? The only option I found is adding |
@timokau, hi, I'm not 100% sure, but I would guess that it's not possible to apply Note that the code in a |
Okay, thanks for the reply. I'll just live with the indentation "issue" then. For what its worth, this illustrates the issue I'm talking about: The indentation issue is:
|
Thanks for this feature! I just realized that |
@wojdyr, that's a really good point. Skipping on |
Subject: A
:skipif:
option for doctest directivesFeature or Bugfix
Purpose
@unittest.skipIf()
decorator. A similar feature would be useful for doctests when run by Sphinx.Detail
Example use cases:
Relates