[Python-checkins] cpython (2.7): Fixed pydoc tests when run with -OO.

serhiy.storchaka python-checkins at python.org
Sun Mar 1 14:33:18 CET 2015


https://hg.python.org/cpython/rev/663a83c1d42d
changeset:   94800:663a83c1d42d
branch:      2.7
parent:      94744:325aec842e3e
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sun Mar 01 15:31:21 2015 +0200
summary:
  Fixed pydoc tests when run with -OO.

files:
  Lib/test/test_pydoc.py |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -399,6 +399,8 @@
             synopsis = pydoc.synopsis(init_path, {})
             self.assertEqual(synopsis, 'my doc')
 
+    @unittest.skipIf(sys.flags.optimize >= 2,
+                     'Docstrings are omitted with -OO and above')
     def test_synopsis_sourceless_empty_doc(self):
         with test.test_support.temp_cwd() as test_dir:
             init_path = os.path.join(test_dir, 'foomod42.py')

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list