Skip to content

Commit 9536fe1

Browse files
[3.11] gh-112001: Fix test_builtins_have_signatures in test_inspect (GH-112002) (GH-112004)
(cherry picked from commit 40752c1) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 5a6d1db commit 9536fe1

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4285,19 +4285,14 @@ def test_builtins_have_signatures(self):
42854285
# These have unrepresentable parameter default values of NULL
42864286
needs_null = {"anext"}
42874287
no_signature |= needs_null
4288-
# These need PEP 457 groups or a signature change to accept None
4289-
needs_semantic_update = {"round"}
4290-
no_signature |= needs_semantic_update
42914288
# These need *args support in Argument Clinic
4292-
needs_varargs = {"breakpoint", "min", "max", "print",
4293-
"__build_class__"}
4289+
needs_varargs = {"breakpoint", "min", "max", "__build_class__"}
42944290
no_signature |= needs_varargs
4295-
# These simply weren't covered in the initial AC conversion
4296-
# for builtin callables
4297-
not_converted_yet = {"open", "__import__"}
4298-
no_signature |= not_converted_yet
42994291
# These builtin types are expected to provide introspection info
4300-
types_with_signatures = set()
4292+
types_with_signatures = {
4293+
'complex', 'enumerate', 'float', 'list', 'memoryview', 'object',
4294+
'property', 'reversed', 'tuple',
4295+
}
43014296
# Check the signatures we expect to be there
43024297
ns = vars(builtins)
43034298
for name, obj in sorted(ns.items()):
@@ -4316,9 +4311,9 @@ def test_builtins_have_signatures(self):
43164311
# This ensures this test will start failing as more signatures are
43174312
# added, so the affected items can be moved into the scope of the
43184313
# regression test above
4319-
for name in no_signature:
4314+
for name in no_signature - needs_null:
43204315
with self.subTest(builtin=name):
4321-
self.assertIsNone(obj.__text_signature__)
4316+
self.assertIsNone(ns[name].__text_signature__)
43224317

43234318
def test_python_function_override_signature(self):
43244319
def func(*args, **kwargs):

0 commit comments

Comments
 (0)