summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSeth Troisi <sethtroisi@google.com>2020-01-27 11:23:18 -0800
committerSeth Troisi <sethtroisi@google.com>2020-01-28 10:22:45 -0800
commitd20378b457813279e75db41840276a8f8e711434 (patch)
tree63ac36c2ede7525024da911498cbe0dce4776d5e /tools
parent7b7197517f31bdfdf6fb1d99944002c90568d705 (diff)
downloadnumpy-d20378b457813279e75db41840276a8f8e711434.tar.gz
DOC: Update refguide_check note on how to skip code
Diffstat (limited to 'tools')
-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