question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH/TST: Doctest narrative documentation

See original GitHub issue

I can’t yet claim to have any detailed oversight of the testing infrastructure of numpy, it definitely seems that a number of narrative documentations are not tested yet, e.g. here: doc/source/reference/.

I’ve tried to force doctest to pick up those tests, but so far it’s without much success. I got to the point with pytest-doctest that the files are found, but for some reasons there are still deselected.

$ ~/munka/devel/numpy [doc_ma_generic L|✚ 2…1⚑ 1] $ pytest -m doctest doc/source/reference/ --doctest-rst
================================================= test session starts ==================================================
platform darwin -- Python 3.7.4, pytest-5.2.0, py-1.8.0, pluggy-0.12.0
rootdir: /Users/bsipocz/munka/devel/numpy, inifile: pytest.ini
plugins: xdist-1.29.0, forked-1.0.2, arraydiff-0.3, xonsh-0.8.3, dependency-0.4.0, remotedata-0.3.2, doctestplus-0.4.0, openfiles-0.4.0, asdf-2.4.2, cov-2.8.1, requests-mock-1.6.0
collected 89 items / 89 deselected   

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mattipcommented, Dec 8, 2019

Superceded by gh-14970, now that refguide-check can test snippets in RST documenation. Please reopen if I missed something.

0reactions
bsipoczcommented, Oct 15, 2019

yes, there are plenty of them, and a few issues opened about code examples that doesn’t work, e.g. here: https://docs.scipy.org/doc/numpy/reference/maskedarray.generic.html

I’m in the middle to clean up that page, but it’s just symptomatic treatment until the doctests are picking those pages up automatically

Read more comments on GitHub >

github_iconTop Results From Across the Web

doctest — Test interactive Python examples — Python 3.11.1 ...
To perform regression testing by verifying that interactive examples from a test file or a test object work as expected. To write tutorial...
Read more >
doctest — Testing Through Documentation — PyMOTW 3
It works by parsing the help text to find examples, running them, then comparing the output text against the expected value.
Read more >
How To Write Doctests in Python - DigitalOcean
Ensuring that code is thoroughly documented and tested not only ensures that a program runs as expected, but also supports collaboration across ...
Read more >
Things I don't like about doctest - Ned Batchelder
Python's doctest is very cool technology, letting you write a narrative in documentation that can then be executed directly to test the code...
Read more >
doctest - Wikipedia
doctest is a module included in the Python programming language's standard library that allows the easy generation of tests based on output from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found