From a05271cc5cbfcbe287dd0014e54e55e4bfe068e4 2021-10-21 01:04:25 From: Matthias Bussonnier Date: 2021-10-21 01:04:25 Subject: [PATCH] Merge pull request #13202 from Kojoley/fix-unintentional-skipping-of-module-level-doctests Fix unintentional skipping of module level doctests --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 167acbd..8ec99f4 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -142,7 +142,7 @@ from traitlets.config.configurable import Configurable import __main__ # skip module docstests -skip_doctest = True +__skip_doctest__ = True try: import jedi diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 0083f53..7511458 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -116,6 +116,8 @@ from IPython.utils import coloransi, py3compat from IPython.core.excolors import exception_colors from IPython.testing.skipdoctest import skip_doctest +# skip module docstests +__skip_doctest__ = True prompt = 'ipdb> ' diff --git a/IPython/extensions/autoreload.py b/IPython/extensions/autoreload.py index f481520..bcf1a19 100644 --- a/IPython/extensions/autoreload.py +++ b/IPython/extensions/autoreload.py @@ -97,7 +97,7 @@ Some of the known remaining caveats are: - C extension modules cannot be reloaded, and so cannot be autoreloaded. """ -skip_doctest = True +__skip_doctest__ = True # ----------------------------------------------------------------------------- # Copyright (C) 2000 Thomas Heller diff --git a/IPython/testing/plugin/ipdoctest.py b/IPython/testing/plugin/ipdoctest.py index 407aeb6..fdc8822 100644 --- a/IPython/testing/plugin/ipdoctest.py +++ b/IPython/testing/plugin/ipdoctest.py @@ -125,7 +125,7 @@ class DocTestFinder(doctest.DocTestFinder): add them to `tests`. """ print('_find for:', obj, name, module) # dbg - if hasattr(obj,"skip_doctest"): + if bool(getattr(obj, "__skip_doctest__", False)): #print 'SKIPPING DOCTEST FOR:',obj # dbg obj = DocTestSkip(obj) diff --git a/IPython/testing/skipdoctest.py b/IPython/testing/skipdoctest.py index b0cf83c..f440ea1 100644 --- a/IPython/testing/skipdoctest.py +++ b/IPython/testing/skipdoctest.py @@ -15,5 +15,5 @@ def skip_doctest(f): This decorator allows you to mark a function whose docstring you wish to omit from testing, while preserving the docstring for introspection, help, etc.""" - f.skip_doctest = True + f.__skip_doctest__ = True return f