summaryrefslogtreecommitdiff
path: root/tools/refguide_check.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/refguide_check.py')
-rw-r--r--tools/refguide_check.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/refguide_check.py b/tools/refguide_check.py
index 28bb3ca30..fbc95f500 100644
--- a/tools/refguide_check.py
+++ b/tools/refguide_check.py
@@ -658,7 +658,6 @@ class Checker(doctest.OutputChecker):
Check the docstrings
"""
obj_pattern = re.compile('at 0x[0-9a-fA-F]+>')
- int_pattern = re.compile('^[0-9]+L?$')
vanilla = doctest.OutputChecker()
rndm_markers = {'# random', '# Random', '#random', '#Random', "# may vary",
"# uninitialized", "#uninitialized"}
@@ -697,11 +696,6 @@ class Checker(doctest.OutputChecker):
if want.lstrip().startswith("#"):
return True
- # python 2 long integers are equal to python 3 integers
- if self.int_pattern.match(want) and self.int_pattern.match(got):
- if want.rstrip("L\r\n") == got.rstrip("L\r\n"):
- return True
-
# try the standard doctest
try:
if self.vanilla.check_output(want, got, optionflags):
@@ -933,6 +927,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
@@ -1178,8 +1180,6 @@ def main(argv):
sys.stderr.write('\n')
sys.stderr.flush()
- all_dict, deprecated, others = get_all_dict(module)
-
if args.rst:
base_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
rst_path = os.path.relpath(os.path.join(base_dir, args.rst))