summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-01-28 23:01:40 +0200
committerGitHub <noreply@github.com>2020-01-28 23:01:40 +0200
commit4d1a3a80ead5b1478f338649d436598aad91f784 (patch)
treeb197e7da73995aa8bc421ce4f3307f419d2db88c
parent96727cf007217256700a1d805569a73d2171f1d5 (diff)
parentd20378b457813279e75db41840276a8f8e711434 (diff)
downloadnumpy-4d1a3a80ead5b1478f338649d436598aad91f784.tar.gz
Merge pull request #15449 from sethtroisi/refguide_doc2
DOC: Update refguide_check note on how to skip code
-rw-r--r--tools/refguide_check.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/refguide_check.py b/tools/refguide_check.py
index ad3f93c42..33c50818b 100644
--- a/tools/refguide_check.py
+++ b/tools/refguide_check.py
@@ -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