@@ -16,12 +16,13 @@ def f(a, b=0, c=0, d=0):
1616 return a + b + c + d
1717
1818
19- def test_one_arguments ():
19+ def test_one_argument ():
2020 """
2121 Check whether no future warning is produced if one
2222 positional argument given.
2323 """
24- assert f (19 ) == 19
24+ with tm .assert_produces_warning (None ):
25+ assert f (19 ) == 19
2526
2627
2728def test_one_and_one_arguments ():
@@ -30,15 +31,17 @@ def test_one_and_one_arguments():
3031 positional argument and one keyword argument are
3132 given.
3233 """
33- assert f (19 , d = 6 ) == 25
34+ with tm .assert_produces_warning (None ):
35+ assert f (19 , d = 6 ) == 25
3436
3537
3638def test_two_arguments ():
3739 """
3840 Check whether no future warning is produced if two
3941 positional arguments given.
4042 """
41- assert f (1 , 5 ) == 6
43+ with tm .assert_produces_warning (None ):
44+ assert f (1 , 5 ) == 6
4245
4346
4447def test_two_and_two_arguments ():
@@ -47,7 +50,8 @@ def test_two_and_two_arguments():
4750 positional arguments and two keyword arguments are
4851 given.
4952 """
50- assert f (1 , 3 , c = 3 , d = 5 ) == 12
53+ with tm .assert_produces_warning (None ):
54+ assert f (1 , 3 , c = 3 , d = 5 ) == 12
5155
5256
5357def test_three_arguments ():
@@ -71,10 +75,11 @@ def test_four_arguments():
7175@deprecate_nonkeyword_arguments (version = "1.1" )
7276def g (a , b = 0 , c = 0 , d = 0 ):
7377 """
74- Sum of one to four numbers, the two last arguments
75- should be given as keyword arguments only
78+ Sum of one to four numbers, but three of them have default
79+ values, so may be given as keyword arguments only.
7680 """
77- return a + b + c + d
81+ with tm .assert_produces_warning (None ):
82+ return a + b + c + d
7883
7984
8085def test_one_and_three_arguments_default_allowed_args ():
@@ -85,7 +90,8 @@ def test_one_and_three_arguments_default_allowed_args():
8590 option, meaning that all arguments with default value
8691 are keyword-only.
8792 """
88- assert g (1 , b = 3 , c = 3 , d = 5 ) == 12
93+ with tm .assert_produces_warning (None ):
94+ assert g (1 , b = 3 , c = 3 , d = 5 ) == 12
8995
9096
9197def test_three_arguments_default_allowed_args ():
0 commit comments