Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_pkg.py @ 59091:8d3ff2fbbe4b
Merged revisions 78351 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78351 | r.david.murray | 2010-02-22 19:24:49 -0500 (Mon, 22 Feb 2010) | 5 lines
Issue 6292: for the moment at least, the test suite passes if run
with -OO. Tests requiring docstrings are skipped. Patch by
Brian Curtin, thanks to Matias Torchinsky for helping review and
improve the patch.
........
| author | R. David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Wed, 24 Feb 2010 01:46:21 +0000 |
| parents | 357e39700489 |
| children | 7b69e630d237 |
line wrap: on
line diff
--- a/Lib/test/test_pkg.py Wed Feb 24 00:10:48 2010 +0000 +++ b/Lib/test/test_pkg.py Wed Feb 24 01:46:21 2010 +0000 @@ -53,7 +53,8 @@ def tearDown(self): sys.path[:] = self.syspath support.modules_cleanup(*self.modules_before) - cleanout(self.root) + if self.root: # Only clean if the test was actually run + cleanout(self.root) # delete all modules concerning the tested hiearchy if self.pkgname: @@ -103,9 +104,6 @@ ] self.mkhier(hier) - import t2 - self.assertEqual(t2.__doc__, "doc for t2") - import t2.sub import t2.sub.subsub self.assertEqual(t2.__name__, "t2") @@ -276,6 +274,17 @@ self.assertFalse(sub) self.assertFalse(subsub) + @unittest.skipIf(sys.flags.optimize >= 2, + "Docstrings are omitted with -O2 and above") + def test_8(self): + hier = [ + ("t8", None), + ("t8 __init__"+os.extsep+"py", "'doc for t8'"), + ] + self.mkhier(hier) + + import t8 + self.assertEqual(t8.__doc__, "doc for t8") def test_main(): support.run_unittest(__name__)
