[3.13] gh-133210: Fix test_inspect without docstrings (GH-139651) (#139670)

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-06 19:13:08 +02:00 committed by GitHub
parent a35e870861
commit 7816ac344c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4385,8 +4385,14 @@ class TestSignatureObject(unittest.TestCase):
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'):