diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-01 13:31:36 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-01 13:31:36 (GMT) |
commit | 4c094e5fd5f0bac4764de99a4991a7f55d3855b4 (patch) | |
tree | 7b735e59865659f83d2d1b8d181007d4bb926b4c | |
parent | efdc16f978d20f2b1937002dffbbe658dad2eff6 (diff) | |
download | cpython-4c094e5fd5f0bac4764de99a4991a7f55d3855b4.zip cpython-4c094e5fd5f0bac4764de99a4991a7f55d3855b4.tar.gz cpython-4c094e5fd5f0bac4764de99a4991a7f55d3855b4.tar.bz2 |
Fixed pydoc tests when run with -OO.
-rw-r--r-- | Lib/test/test_pydoc.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 6a44c22..83f2ec9 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -478,6 +478,8 @@ class PydocDocTest(unittest.TestCase): self.assertEqual(expected, result, "documentation for missing module found") + @unittest.skipIf(sys.flags.optimize >= 2, + 'Docstrings are omitted with -OO and above') def test_not_ascii(self): result = run_pydoc('test.test_pydoc.nonascii', PYTHONIOENCODING='ascii') encoded = nonascii.__doc__.encode('ascii', 'backslashreplace') @@ -562,6 +564,8 @@ class PydocDocTest(unittest.TestCase): synopsis = pydoc.synopsis(TESTFN, {}) self.assertEqual(synopsis, 'line 1: h\xe9') + @unittest.skipIf(sys.flags.optimize >= 2, + 'Docstrings are omitted with -OO and above') def test_synopsis_sourceless(self): expected = os.__doc__.splitlines()[0] filename = os.__cached__ |