-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
While working on #103406 I've noticed that there are some problems with test_inspect
that we can easily fix.
List of problems I found:
cpython/Lib/test/test_inspect.py
Lines 1840 to 1845 in 2b6f5c3
f3 = self.makeCallable('**c') self.assertEqualException(f3, '1, 2') self.assertEqualException(f3, '1, 2, a=1, b=2') f4 = self.makeCallable('*, a, b=0') self.assertEqualException(f3, '1, 2') self.assertEqualException(f3, '1, 2, a=1, b=2') f4
is not ever used, butf3
has duplicate asserts. It looks like a copy-paste error to me. I propose to add asserts forf4
as wellcpython/Lib/test/test_inspect.py
Lines 1835 to 1838 in 2b6f5c3
# XXX: Python inconsistency # - for functions and bound methods: unexpected keyword 'c' # - for unbound methods: multiple values for keyword 'a' #self.assertEqualException(f, '1, c=3, a=2') cpython/Lib/test/test_inspect.py
Lines 1823 to 1824 in 2b6f5c3
# XXX: success of this one depends on dict order ## self.assertEqualException(f, '2, 3, 4, a=1, c=5') cpython/Lib/test/test_inspect.py
Line 2991 in 2b6f5c3
psig = inspect.signature(partial(partial(test, 1), 2)) cpython/Lib/test/test_inspect.py
Lines 2987 to 2989 in 2b6f5c3
self.assertEqual(self.signature(partial(partial(test, 1), 2)), ((('c', ..., int, "positional_or_keyword"),), 42)) - There are also several unsused variables that can be removed durin this cleanup
Here's my PR :)
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error