From: sobolevn Date: Mon, 6 Oct 2025 16:48:50 +0000 (+0300) Subject: gh-133210: Fix `test_inspect` without docstrings (#139651) X-Git-Tag: v3.15.0a1~108 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c70cc5c23971ef448ea59827c6e6ae310157356;p=thirdparty%2FPython%2Fcpython.git gh-133210: Fix `test_inspect` without docstrings (#139651) --- diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py index 555efb78dcc6..e32e34c63b53 100644 --- a/Lib/test/test_inspect/test_inspect.py +++ b/Lib/test/test_inspect/test_inspect.py @@ -4261,8 +4261,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'):