pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ipython/ipython/commit/17153999ccdd336213a1e2d85ffc4b66f402e595

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7a1ad343bd40328c.css" /> Fix unintentional skipping of module level doctests · ipython/ipython@1715399 · GitHub
Skip to content

Commit 1715399

Browse files
committed
Fix unintentional skipping of module level doctests
Importing `skip_doctest` decorator unintentionally marks for skipping a module level doctest. It happens because doctests discovery only checks whether a variable with name `skip_doctest` is presented without checking the type. I have renamed the 'magic' variable name to `__skip_doctest__` to resolve the name clash, and also made the check actually depend on the variable content. The module level doctest in `core/debugger.py` was previously unintentionally skipped and now is disabled because it contains syntax/name errors.
1 parent 4e5c2e2 commit 1715399

5 files changed

Lines changed: 6 additions & 4 deletions

File tree

IPython/core/completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
import __main__
143143

144144
# skip module docstests
145-
skip_doctest = True
145+
__skip_doctest__ = True
146146

147147
try:
148148
import jedi

IPython/core/debugger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
from IPython.core.excolors import exception_colors
117117
from IPython.testing.skipdoctest import skip_doctest
118118

119+
# skip module docstests
120+
__skip_doctest__ = True
119121

120122
prompt = 'ipdb> '
121123

IPython/extensions/autoreload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
- C extension modules cannot be reloaded, and so cannot be autoreloaded.
9898
"""
9999

100-
skip_doctest = True
100+
__skip_doctest__ = True
101101

102102
# -----------------------------------------------------------------------------
103103
# Copyright (C) 2000 Thomas Heller

IPython/testing/plugin/ipdoctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
125125
add them to `tests`.
126126
"""
127127
print('_find for:', obj, name, module) # dbg
128-
if hasattr(obj,"skip_doctest"):
128+
if bool(getattr(obj, "__skip_doctest__", False)):
129129
#print 'SKIPPING DOCTEST FOR:',obj # dbg
130130
obj = DocTestSkip(obj)
131131

IPython/testing/skipdoctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def skip_doctest(f):
1515
This decorator allows you to mark a function whose docstring you wish to
1616
omit from testing, while preserving the docstring for introspection, help,
1717
etc."""
18-
f.skip_doctest = True
18+
f.__skip_doctest__ = True
1919
return f

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy