diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-03-21 19:02:30 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-03-21 19:02:30 (GMT) |
commit | b3f95d7ff17f64de1a3b9b0d1e36d9a89748be3f (patch) | |
tree | 59ed50c18fb08f1c92669757e87ffd2ad266cce3 | |
parent | 7c010ee00cc0bfb859c326d9a78bd8dd2bf92246 (diff) | |
download | cpython-b3f95d7ff17f64de1a3b9b0d1e36d9a89748be3f.zip cpython-b3f95d7ff17f64de1a3b9b0d1e36d9a89748be3f.tar.gz cpython-b3f95d7ff17f64de1a3b9b0d1e36d9a89748be3f.tar.bz2 |
#12757: Make doctest skipping in -OO mode work with unittest/regrtest -v
-rw-r--r-- | Lib/doctest.py | 10 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 8297fad..095f560 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -2314,7 +2314,8 @@ class DocTestCase(unittest.TestCase): return "Doctest: " + self._dt_test.name class SkipDocTestCase(DocTestCase): - def __init__(self): + def __init__(self, module): + self.module = module DocTestCase.__init__(self, None) def setUp(self): @@ -2324,7 +2325,10 @@ class SkipDocTestCase(DocTestCase): pass def shortDescription(self): - return "Skipping tests from %s" % module.__name__ + return "Skipping tests from %s" % self.module.__name__ + + __str__ = shortDescription + def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, **options): @@ -2372,7 +2376,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.addTest(SkipDocTestCase()) + suite.addTest(SkipDocTestCase(module)) return suite elif not tests: # Why do we want to do this? Because it reveals a bug that might @@ -27,6 +27,9 @@ Core and Builtins Library ------- +- Issue #12757: Fix the skipping of doctests when python is run with -OO so + that it works in unittest's verbose mode as well as non-verbose mode. + - Issue #3573: IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)) (Patch by Guilherme Polo) |