From d8bdc1e6f7e394cac8a682fa8209ceeb58acd80b Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:14:19 +0200 Subject: [PATCH] [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 7c70cc5c23971ef448ea59827c6e6ae310157356) Co-authored-by: sobolevn --- Lib/test/test_inspect/test_inspect.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py index 0c4c878ea492..94804eb13541 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'): -- 2.47.3