Cannot run doctests on a single rst file with --test-path option
See original GitHub issueI used to be able to run the doctests in a single rst
file using the test runner -t
(--test-path
) option, e.g.:
python setup.py test -t docs/overview.rst
Unexpectedly, this command now runs all of the doctests. The -t
option still works as expected for a single python module.
Also, the -t
option states that it “May also be an absolute path”. When I used an absolute path to an rst
file, I got “ERROR: not found (no name ‘<fullpath>
’ in any of [])”. When I used an absolute path to a py
file, I got two KeyError
s from pytest
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
doctest running in sphinx doc - Stack Overflow
I should just run the following command: $ pytest 'path to static rst files' --doctest-glob=*.rst --doctest-module.
Read more >Issue 15629: Add to regrtest the ability to run Lib and Doc doctests ...
One option for whitelisting files would be to subclass doctest.DocTestParser and pass an instance as the parser argument to doctest.DocFileSuite: http://docs.
Read more >pytest Documentation - Read the Docs
pytest will run all files of the form test_*.py or *_test.py in the ... so it doesn't matter which one runs first because...
Read more >run doctests with nose - Read the Docs
When loading doctests from non-module files, use the --doctest-fixtures switch to specify how to find modules containing fixtures for the tests. A module...
Read more >Source code for astropy.tests.runner
Don't import pytest until it's actually needed to run the tests import pytest ... "Test path must be a directory or a path...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To make sure @larrybradley retains primacy in this vital matter, I need to admit that he told me about it last week and I forgot to pursue it then. Sorry to steal your hipster cred, @eteq.
and the tests for downstream packages using the astropy test runner 😉