10000 DOC: Update refguide_check note on how to skip code by sethtroisi · Pull Request #15449 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Update refguide_check note on how to skip code #15449

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

Merged
merged 1 commit into from
Jan 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/refguide_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,14 @@ def check_doctests_testfile(fname, verbose, ns=None,
Notes
-----

refguide can be signalled to skip testing code by adding
``#doctest: +SKIP`` to the end of the line. If the output varies or is
random, add ``# may vary`` or ``# random`` to the comment. for example

>>> plt.plot(...) # doctest: +SKIP
>>> random.randint(0,10)
5 # random

We also try to weed out pseudocode:
* We maintain a list of exceptions which signal pseudocode,
* We split the text file into "blocks" of code separated by empty lines
Expand Down
0