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

Skip to content

Commit 3de4aae

Browse files
Fixed pydoc tests when run with -OO.
2 parents 71c6f44 + 4c094e5 commit 3de4aae

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
@@ -467,6 +467,8 @@ def test_not_here(self):
467467
self.assertEqual(expected, result,
468468
"documentation for missing module found")
469469

470+
@unittest.skipIf(sys.flags.optimize >= 2,
471+
'Docstrings are omitted with -OO and above')
470472
def test_not_ascii(self):
471473
result = run_pydoc('test.test_pydoc.nonascii', PYTHONIOENCODING='ascii')
472474
encoded = nonascii.__doc__.encode('ascii', 'backslashreplace')
@@ -551,6 +553,8 @@ def test_synopsis(self):
551553
synopsis = pydoc.synopsis(TESTFN, {})
552554
self.assertEqual(synopsis, 'line 1: h\xe9')
553555

556+
@unittest.skipIf(sys.flags.optimize >= 2,
557+
'Docstrings are omitted with -OO and above')
554558
def test_synopsis_sourceless(self):
555559
expected = os.__doc__.splitlines()[0]
556560
filename = os.__cached__

0 commit comments

Comments
 (0)