Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c094e5

Browse files
Fixed pydoc tests when run with -OO.
1 parent efdc16f commit 4c094e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_pydoc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ def test_not_here(self):
478478
self.assertEqual(expected, result,
479479
"documentation for missing module found")
480480

481+
@unittest.skipIf(sys.flags.optimize >= 2,
482+
'Docstrings are omitted with -OO and above')
481483
def test_not_ascii(self):
482484
result = run_pydoc('test.test_pydoc.nonascii', PYTHONIOENCODING='ascii')
483485
encoded = nonascii.__doc__.encode('ascii', 'backslashreplace')
@@ -562,6 +564,8 @@ def test_synopsis(self):
562564
synopsis = pydoc.synopsis(TESTFN, {})
563565
self.assertEqual(synopsis, 'line 1: h\xe9')
564566

567+
@unittest.skipIf(sys.flags.optimize >= 2,
568+
'Docstrings are omitted with -OO and above')
565569
def test_synopsis_sourceless(self):
566570
expected = os.__doc__.splitlines()[0]
567571
filename = os.__cached__

0 commit comments

Comments
 (0)