@@ -1820,8 +1820,7 @@ def test_errors(self):
18201820self .assertEqualException (f ,'2, 3, 4' )
18211821self .assertEqualException (f ,'1, 2, 3, a=1' )
18221822self .assertEqualException (f ,'2, 3, 4, c=5' )
1823- # XXX: success of this one depends on dict order
1824- ## self.assertEqualException(f, '2, 3, 4, a=1, c=5')
1823+ self .assertEqualException (f ,'2, 3, 4, a=1, c=5' )
18251824# f got an unexpected keyword argument
18261825self .assertEqualException (f ,'c=2' )
18271826self .assertEqualException (f ,'2, c=3' )
@@ -1832,17 +1831,19 @@ def test_errors(self):
18321831self .assertEqualException (f ,'1, a=2' )
18331832self .assertEqualException (f ,'1, **{"a":2}' )
18341833self .assertEqualException (f ,'1, 2, b=3' )
1835- # XXX: Python inconsistency
1836- # - for functions and bound methods: unexpected keyword 'c'
1837- # - for unbound methods: multiple values for keyword 'a'
1838- #self.assertEqualException(f, '1, c=3, a=2')
1834+ self .assertEqualException (f ,'1, c=3, a=2' )
18391835# issue11256:
18401836f3 = self .makeCallable ('**c' )
18411837self .assertEqualException (f3 ,'1, 2' )
18421838self .assertEqualException (f3 ,'1, 2, a=1, b=2' )
18431839f4 = self .makeCallable ('*, a, b=0' )
1844- self .assertEqualException (f3 ,'1, 2' )
1845- self .assertEqualException (f3 ,'1, 2, a=1, b=2' )
1840+ self .assertEqualException (f4 ,'1, 2' )
1841+ self .assertEqualException (f4 ,'1, 2, a=1, b=2' )
1842+ self .assertEqualException (f4 ,'a=1, a=3' )
1843+ self .assertEqualException (f4 ,'a=1, c=3' )
1844+ self .assertEqualException (f4 ,'a=1, a=3, b=4' )
1845+ self .assertEqualException (f4 ,'a=1, b=2, a=3, b=4' )
1846+ self .assertEqualException (f4 ,'a=1, a=2, a=3, b=4' )
18461847
18471848# issue #20816: getcallargs() fails to iterate over non-existent
18481849# kwonlydefaults and raises a wrong TypeError
@@ -2872,8 +2873,6 @@ def foo(cls, *, arg):
28722873def test_signature_on_partial (self ):
28732874from functools import partial
28742875
2875- Parameter = inspect .Parameter
2876-
28772876def test ():
28782877pass
28792878
@@ -2988,8 +2987,6 @@ def test(a, b, c:int) -> 42:
29882987 ((('c' , ...,int ,"positional_or_keyword" ),),
2989298842 ))
29902989
2991- psig = inspect .signature (partial (partial (test ,1 ),2 ))
2992-
29932990def foo (a ):
29942991return a
29952992_foo = partial (partial (foo ,a = 10 ),a = 20 )
@@ -4153,8 +4150,6 @@ def test(a, *args, b, z=100, **kwargs):
41534150self .assertEqual (ba .args , (10 ,20 ))
41544151
41554152def test_signature_bind_positional_only (self ):
4156- P = inspect .Parameter
4157-
41584153def test (a_po ,b_po ,c_po = 3 ,/ ,foo = 42 ,* ,bar = 50 ,** kwargs ):
41594154return a_po ,b_po ,c_po ,foo ,bar ,kwargs
41604155
@@ -4578,7 +4573,6 @@ def test_qualname_source(self):
45784573self .assertEqual (err ,b'' )
45794574
45804575def test_builtins (self ):
4581- module = importlib .import_module ('unittest' )
45824576_ ,out ,err = assert_python_failure ('-m' ,'inspect' ,
45834577'sys' )
45844578lines = err .decode ().splitlines ()