mirror of
https://github.com/python/cpython.git
synced 2025-09-29 11:45:57 +00:00
[3.12] gh-112001: Fix test_builtins_have_signatures in test_inspect (GH-112002) (GH-112003)
(cherry picked from commit 40752c1c1e
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
158a7e1acd
commit
378a96e361
1 changed files with 7 additions and 12 deletions
|
@ -4516,19 +4516,14 @@ class TestSignatureDefinitions(unittest.TestCase):
|
||||||
# These have unrepresentable parameter default values of NULL
|
# These have unrepresentable parameter default values of NULL
|
||||||
needs_null = {"anext"}
|
needs_null = {"anext"}
|
||||||
no_signature |= needs_null
|
no_signature |= needs_null
|
||||||
# These need PEP 457 groups or a signature change to accept None
|
|
||||||
needs_semantic_update = {"round"}
|
|
||||||
no_signature |= needs_semantic_update
|
|
||||||
# These need *args support in Argument Clinic
|
# These need *args support in Argument Clinic
|
||||||
needs_varargs = {"breakpoint", "min", "max", "print",
|
needs_varargs = {"breakpoint", "min", "max", "__build_class__"}
|
||||||
"__build_class__"}
|
|
||||||
no_signature |= needs_varargs
|
no_signature |= needs_varargs
|
||||||
# These simply weren't covered in the initial AC conversion
|
|
||||||
# for builtin callables
|
|
||||||
not_converted_yet = {"open", "__import__"}
|
|
||||||
no_signature |= not_converted_yet
|
|
||||||
# These builtin types are expected to provide introspection info
|
# These builtin types are expected to provide introspection info
|
||||||
types_with_signatures = set()
|
types_with_signatures = {
|
||||||
|
'complex', 'enumerate', 'float', 'list', 'memoryview', 'object',
|
||||||
|
'property', 'reversed', 'tuple',
|
||||||
|
}
|
||||||
# Check the signatures we expect to be there
|
# Check the signatures we expect to be there
|
||||||
ns = vars(builtins)
|
ns = vars(builtins)
|
||||||
for name, obj in sorted(ns.items()):
|
for name, obj in sorted(ns.items()):
|
||||||
|
@ -4547,9 +4542,9 @@ class TestSignatureDefinitions(unittest.TestCase):
|
||||||
# This ensures this test will start failing as more signatures are
|
# This ensures this test will start failing as more signatures are
|
||||||
# added, so the affected items can be moved into the scope of the
|
# added, so the affected items can be moved into the scope of the
|
||||||
# regression test above
|
# regression test above
|
||||||
for name in no_signature:
|
for name in no_signature - needs_null - needs_groups:
|
||||||
with self.subTest(builtin=name):
|
with self.subTest(builtin=name):
|
||||||
self.assertIsNone(obj.__text_signature__)
|
self.assertIsNone(ns[name].__text_signature__)
|
||||||
|
|
||||||
def test_python_function_override_signature(self):
|
def test_python_function_override_signature(self):
|
||||||
def func(*args, **kwargs):
|
def func(*args, **kwargs):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue