mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-81682: Fix test failures when CPython is built without docstrings (GH-113410)
This commit is contained in:
parent
c3f92f6a75
commit
4e5b27e6a3
12 changed files with 55 additions and 21 deletions
|
@ -7,6 +7,7 @@ import textwrap
|
|||
import types
|
||||
import re
|
||||
from idlelib.idle_test.mock_tk import Text
|
||||
from test.support import MISSING_C_DOCSTRINGS
|
||||
|
||||
|
||||
# Test Class TC is used in multiple get_argspec test methods
|
||||
|
@ -50,6 +51,8 @@ class Get_argspecTest(unittest.TestCase):
|
|||
# but a red buildbot is better than a user crash (as has happened).
|
||||
# For a simple mismatch, change the expected output to the actual.
|
||||
|
||||
@unittest.skipIf(MISSING_C_DOCSTRINGS,
|
||||
"Signature information for builtins requires docstrings")
|
||||
def test_builtins(self):
|
||||
|
||||
def tiptest(obj, out):
|
||||
|
@ -143,6 +146,8 @@ you\'ll probably have to override _wrap_chunks().''')
|
|||
f.__doc__ = 'a'*300
|
||||
self.assertEqual(get_spec(f), f"()\n{'a'*(calltip._MAX_COLS-3) + '...'}")
|
||||
|
||||
@unittest.skipIf(MISSING_C_DOCSTRINGS,
|
||||
"Signature information for builtins requires docstrings")
|
||||
def test_multiline_docstring(self):
|
||||
# Test fewer lines than max.
|
||||
self.assertEqual(get_spec(range),
|
||||
|
@ -157,6 +162,7 @@ bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
|
|||
bytes(int) -> bytes object of size given by the parameter initialized with null bytes
|
||||
bytes() -> empty bytes object''')
|
||||
|
||||
def test_multiline_docstring_2(self):
|
||||
# Test more than max lines
|
||||
def f(): pass
|
||||
f.__doc__ = 'a\n' * 15
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue