@@ -4981,6 +4981,18 @@ def test_kwds_with_pos_only(self):
49814981 self .assertEqual (ac_tester .kwds_with_pos_only (1 , 2 , y = 'y' , z = 'z' ), (1 , 2 , kwds ))
49824982 self .assertEqual (ac_tester .kwds_with_pos_only (1 , 2 , ** kwds ), (1 , 2 , kwds ))
49834983
4984+ def test_kwds_with_optional_pos_only (self ):
4985+ with self .assertRaises (TypeError ):
4986+ ac_tester .kwds_with_optional_pos_only ()
4987+ with self .assertRaises (TypeError ):
4988+ ac_tester .kwds_with_optional_pos_only (y = 'y' )
4989+ self .assertEqual (ac_tester .kwds_with_optional_pos_only (1 ), (1 , None , {}))
4990+ self .assertEqual (ac_tester .kwds_with_optional_pos_only (1 , 2 ), (1 , 2 , {}))
4991+ self .assertEqual (ac_tester .kwds_with_optional_pos_only (1 , y = 'y' ),
4992+ (1 , None , {'y' : 'y' }))
4993+ self .assertEqual (ac_tester .kwds_with_optional_pos_only (1 , 2 , y = 'y' ),
4994+ (1 , 2 , {'y' : 'y' }))
4995+
49844996 def test_kwds_with_stararg (self ):
49854997 self .assertEqual (ac_tester .kwds_with_stararg (), ((), {}))
49864998 self .assertEqual (ac_tester .kwds_with_stararg (1 , 2 ), ((1 , 2 ), {}))
0 commit comments