From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:13:08 +0000 (+0200) Subject: [3.13] gh-133210: Fix `test_inspect` without docstrings (GH-139651) (#139670) X-Git-Tag: v3.13.8~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7816ac344cd1bb1800308c1787c2c44e50dcd7cf;p=thirdparty%2FPython%2Fcpython.git [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 7c70cc5c23971ef448ea59827c6e6ae310157356) Co-authored-by: sobolevn --- diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py index 3e73dc5fe269..691c2ffd5cc1 100644 --- a/Lib/test/test_inspect/test_inspect.py +++ b/Lib/test/test_inspect/test_inspect.py @@ -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'):