Skip to content

Commit ce11132

Browse files
sobolevndanigm
authored andcommitted
pythongh-133210: Fix test_inspect without docstrings (python#139651)
1 parent f9bf0f5 commit ce11132

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,8 +4261,14 @@ def __init__(self, a):
42614261

42624262
self.assertEqual(self.signature(C, follow_wrapped=False),
42634263
varargs_signature)
4264-
self.assertEqual(self.signature(C.__new__, follow_wrapped=False),
4265-
varargs_signature)
4264+
if support.MISSING_C_DOCSTRINGS:
4265+
self.assertRaisesRegex(
4266+
ValueError, "no signature found",
4267+
self.signature, C.__new__, follow_wrapped=False,
4268+
)
4269+
else:
4270+
self.assertEqual(self.signature(C.__new__, follow_wrapped=False),
4271+
varargs_signature)
42664272

42674273
def test_signature_on_class_with_wrapped_new(self):
42684274
with self.subTest('FunctionType'):

0 commit comments

Comments
 (0)