-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Decide what should we do with doctests in CI #111704
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
Comments
I hope that I will send the first PR today / tomorrow, but I am a bit sick :( |
Option (2) is definitely attractive. Just two concerns from me:
|
Also, rest up and get well soon! |
This is option 2 :) |
After working with
.. testcleanup::
import os
os.remove("tutorial.db")
I didn't like this tool at all. |
Can't you just not add |
Turns out that the answer is "no". |
Bug report
Initial PR and discussion: #111682
So, here's the problem:
We have two tools:
doctest
(builtin module) andsphinx
(3rd party) that can run these samples as doctests. The problem is that they define "doctest" term differently:doctest
module says that both of these examples are doctestssphinx
says that only example with.. doctest::
directive is a doctestThis is problematic, because not all example are actually executed in CI, right now we have a CI job that uses Sphinx. So, in the result of this we have broken doctest (1st meaning) examples in the docs.
Examples:
What can we do?
Options:
.. doctest::
directives everywhere, but I think it is too much work and people will forget to do thisdoctest_test_doctest_blocks
, see docs https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html This is what I plan to do locally and I will send a PR with the results. I fear that quite a lot of doctests might be brokentest_*
files using something likeThe last option is also problematic, because right now we can only run doctests in CI, when PR only touches
Doc/
folder, I am not sure that it will be easy with this setup.CC @AlexWaygood @AA-Turner
Linked PRs
doctest_test_doctest_blocks
option to Sphinx #111723The text was updated successfully, but these errors were encountered: