pytest-sphinx
pytest-sphinx copied to clipboard
sphinx doctest plugin for pytest
First of all, thank you for writing `pytest-sphinx`. I find it much nicer to use than `sphinx-build`. I use `pytest-sphinx` in a [project](https://github.com/cr1901/smolarith) to good effect. However, past-me wrote a...
This PR adds support for MyST syntax like: `````` ```{testcode} group :skipif: True print('ham') ``` ```{testoutput} :options: +NORMALIZE_WHITESPACE ham ``` ``````
Implements #37 ## What's incomplete - Tests - Potentially: - pytest reporting / line numbers - [pytest doctest](https://github.com/pytest-dev/pytest/blob/7.1.x/src/_pytest/doctest.py) may be causing duplicate test items ## What's supported - reStructuredText: Pure...
re: #30 Naïve [`eval-rst`](https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#roles-directives:~:text=For%20special%20cases%2C%20MySt%20also%20offers%20the%20eval%2Drst%20directive.%20This%20will%20parse%20the%20content%20as%20ReStructuredText%3A) directive support. - Support `.md` - Adds `testdata/using_the_shapereader.md` - Tests `using_the_shapereader.md` in `test_cartopy` - Support for `{eval-rst}` and tests - `_DIRECTIVE_RE` improvements - Use verbose, named...
* currently only supported in the testoutput directive * completely skips the doctest if the expression in :skipif: evaluates to True. It is planned to extend this commit s.t. the...
I saw in the README that support for `testsetup` is planned but didn't see an issue to track it, so thought I'd create one and register interest to boot. Is...
See http://www.sphinx-doc.org/en/master/usage/extensions/doctest.html#skipping-tests-conditionally - [x] in testoutput - [x] in testcode - [ ] in doctest - [ ] in testsetup/testcleanup
I think having docutils as a backend parser will make the experience more resilient + make myst easier to integrate. But I am not all the way through the APIs...
I think the MockAwareDoctestFinder code from https://github.com/thisch/pytest-sphinx/blob/0e4ec60b720ba8d6afd1cf24e2a20e3ba8d6dd4f/pytest_sphinx.py#L494 can be removed (once we drop support for < python 3.10), because the issue we had with it has been fixed (I guess)...