[3.14] gh-133210: Fix test_inspect without docstrings (GH-139651) (#139776)

gh-133210: Fix `test_inspect` without docstrings (GH-139651)
(cherry picked from commit 7c70cc5c23)

Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2025-10-08 16:14:19 +02:00 committed by GitHub
parent b5230d73a9
commit d8bdc1e6f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4261,8 +4261,14 @@ def __init__(self, a):
self.assertEqual(self.signature(C, follow_wrapped=False),
varargs_signature)
self.assertEqual(self.signature(C.__new__, follow_wrapped=False),
varargs_signature)
if support.MISSING_C_DOCSTRINGS:
self.assertRaisesRegex(
ValueError, "no signature found",
self.signature, C.__new__, follow_wrapped=False,
)
else:
self.assertEqual(self.signature(C.__new__, follow_wrapped=False),
varargs_signature)
def test_signature_on_class_with_wrapped_new(self):
with self.subTest('FunctionType'):