-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for :skipif: #9
Comments
I need that, too! |
Before I can continue working on this I need to do some preparations, one of them is to add a test-framework that runs |
I'll soon upload a PR for adding support for @dc3671 In which directives do you want to use |
@Thisch just |
I'll probably release a new version of pytest-sphinx containing support for |
Hi @Thisch, just found my way to this issue and am wondering about the status. I'm specifically interested in "skipif" support for On Apr 21, 2020 you wrote:
...and there was in fact a new version released a few months later, though https://github.com/thisch/pytest-sphinx/blob/master/CHANGELOG.md#03---2020-08-04 doesn't mention Thanks for maintaining this package, and looking forward to being able to hopefully use it once this issue is fixed. |
* Use pytest-sphinx to have pytest run doctests in Sphinx docs rather than using Sphinx to run these via run_tests.py. * Sphinx is no longer a test dependency, which allows upgrading to Sphinx 6.0 while still being able to run the tests with Python 3.7. (Sphinx 6.0 dropped support for 3.7.) * Use conftest.py rather than testsetup or doctest_global_setup, which pytest-sphinx does not currently support. * Don't use :skipif: in doctest:: directives since pytest-sphinx does not currently support it (twmr/pytest-sphinx#9). Instead just don't ever run the one doctest that was using this, since the behavior it was testing is also covered by several tests in test_properties.py that do still properly get run conditionally (specifically, the "freed on zero refcount" tests are still run on CPython but not PyPy). * Don't use >>> for code we don't want to test, since pytest-sphinx will otherwise still run it even if it's in a code-block directive (and sprinkling `# doctest: SKIP` everywhere as an alternative is noisy). * Add pytest-clarity to dev dependencies and pass -vv to pytest by default to enable pytest-clarity's nicer diffs in development.
Just hit a related issue combining the recommended workaround for #5 with the current :skipif: support. Mentioning here in case it's worth adding an associated checkbox to this issue's description. |
* Use pytest-sphinx to have pytest run doctests in Sphinx docs rather than using Sphinx to run these via run_tests.py. * Sphinx is no longer a test dependency, which allows upgrading to Sphinx 6.0 while still being able to run the tests with Python 3.7. (Sphinx 6.0 dropped support for 3.7.) * Use conftest.py rather than testsetup or doctest_global_setup, which pytest-sphinx does not currently support. * Don't use :skipif: in doctest:: directives since pytest-sphinx does not currently support it (twmr/pytest-sphinx#9). Instead just don't ever run the one doctest that was using this, since the behavior it was testing is also covered by several tests in test_properties.py that do still properly get run conditionally (specifically, the "freed on zero refcount" tests are still run on CPython but not PyPy). * Don't use >>> for code we don't want to test, since pytest-sphinx will otherwise still run it even if it's in a code-block directive (and sprinkling `# doctest: SKIP` everywhere as an alternative is noisy). * Add pytest-clarity to dev dependencies and pass -vv to pytest by default to enable pytest-clarity's nicer diffs in development.
* Use pytest-sphinx to have pytest run doctests in Sphinx docs rather than using Sphinx to run these via run_tests.py. * Sphinx is no longer a test dependency, which allows upgrading to Sphinx 6.0 while still being able to run the tests with Python 3.7. (Sphinx 6.0 dropped support for 3.7.) * Use conftest.py rather than testsetup or doctest_global_setup, which pytest-sphinx does not currently support. * Don't use :skipif: in doctest:: directives since pytest-sphinx does not currently support it (twmr/pytest-sphinx#9). Instead just don't ever run the one doctest that was using this, since the behavior it was testing is also covered by several tests in test_properties.py that do still properly get run conditionally (specifically, the "freed on zero refcount" tests are still run on CPython but not PyPy). * Don't use >>> for code we don't want to test, since pytest-sphinx will otherwise still run it even if it's in a code-block directive (and sprinkling `# doctest: SKIP` everywhere as an alternative is noisy). * Add pytest-clarity to dev dependencies and pass -vv to pytest by default to enable pytest-clarity's nicer diffs in development.
See http://www.sphinx-doc.org/en/master/usage/extensions/doctest.html#skipping-tests-conditionally
The text was updated successfully, but these errors were encountered: