Skip to content

Commit 38c4eeb

Browse files
sobolevnmiss-islington
authored andcommitted
pythongh-133210: Fix test_inspect without docstrings (pythonGH-139651)
(cherry picked from commit 7c70cc5c23971ef448ea59827c6e6ae310157356) Co-authored-by: sobolevn <[email protected]>
1 parent a35e870 commit 38c4eeb

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
@@ -4385,8 +4385,14 @@ def __init__(self, a):
43854385

43864386
self.assertEqual(self.signature(C, follow_wrapped=False),
43874387
varargs_signature)
4388-
self.assertEqual(self.signature(C.__new__, follow_wrapped=False),
4389-
varargs_signature)
4388+
if support.MISSING_C_DOCSTRINGS:
4389+
self.assertRaisesRegex(
4390+
ValueError, "no signature found",
4391+
self.signature, C.__new__, follow_wrapped=False,
4392+
)
4393+
else:
4394+
self.assertEqual(self.signature(C.__new__, follow_wrapped=False),
4395+
varargs_signature)
43904396

43914397
def test_signature_on_class_with_wrapped_new(self):
43924398
with self.subTest('FunctionType'):

0 commit comments

Comments
 (0)