summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2013-08-28 22:24:39 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2013-08-28 22:24:39 (GMT)
commit7c1017bfee891a9442f21d21d46e429a11f7218f (patch)
tree00adb14e54753928369beae390af4df6325da134
parenteb9736845182a732b2fcfb32730984d7c6fff7f3 (diff)
downloadcpython-7c1017bfee891a9442f21d21d46e429a11f7218f.zip
cpython-7c1017bfee891a9442f21d21d46e429a11f7218f.tar.gz
cpython-7c1017bfee891a9442f21d21d46e429a11f7218f.tar.bz2
Fix tests for #11798
-rw-r--r--Lib/doctest.py12
-rw-r--r--Lib/test/test_pyclbr.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index a26c040..7836fd2 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -2290,6 +2290,12 @@ class SkipDocTestCase(DocTestCase):
__str__ = shortDescription
+class _DocTestSuite(unittest.TestSuite):
+
+ def _removeTestAtIndex(self, index):
+ pass
+
+
def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
**options):
"""
@@ -2335,7 +2341,7 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
if not tests and sys.flags.optimize >=2:
# Skip doctests when running with -O2
- suite = unittest.TestSuite()
+ suite = _DocTestSuite()
suite.addTest(SkipDocTestCase(module))
return suite
elif not tests:
@@ -2349,7 +2355,7 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
raise ValueError(module, "has no docstrings")
tests.sort()
- suite = unittest.TestSuite()
+ suite = _DocTestSuite()
for test in tests:
if len(test.examples) == 0:
@@ -2459,7 +2465,7 @@ def DocFileSuite(*paths, **kw):
encoding
An encoding that will be used to convert the files to unicode.
"""
- suite = unittest.TestSuite()
+ suite = _DocTestSuite()
# We do this here so that _normalize_module is called at the right
# level. If it were called in DocFileTest, then this function
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index c094455..88aff89 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -142,7 +142,7 @@ class PyclbrTest(TestCase):
self.checkModule('pyclbr')
self.checkModule('ast')
self.checkModule('doctest', ignore=("TestResults", "_SpoofOut",
- "DocTestCase"))
+ "DocTestCase", '_DocTestSuite'))
self.checkModule('difflib', ignore=("Match",))
def test_decorators(self):