Skip to content

Commit 594c22c

Browse files
committed
Fix tests for deprecate_nonkeyword_argument
1 parent 7d1e145 commit 594c22c

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

pandas/tests/util/test_deprecate_nonkeyword_arguments.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,32 @@ def f(a, b=0, c=0, d=0):
1616
return a + b + c + d
1717

1818

19-
def test_two_arguments(x):
19+
def test_one_arguments():
20+
"""
21+
Check whether no future warning is produced if one
22+
positional argument given.
23+
"""
24+
assert f(19) == 19
25+
26+
27+
def test_one_and_one_arguments():
28+
"""
29+
Check whether no future warning is produced if one
30+
positional argument and one keyword argument are
31+
given.
32+
"""
33+
assert f(19, d=6) == 25
34+
35+
36+
def test_two_arguments():
2037
"""
2138
Check whether no future warning is produced if two
2239
positional arguments given.
2340
"""
2441
assert f(1, 5) == 6
2542

2643

27-
def test_two_and_two_arguments(x):
44+
def test_two_and_two_arguments():
2845
"""
2946
Check whether no future warning is produced if two
3047
positional arguments and two keyword arguments are
@@ -33,7 +50,16 @@ def test_two_and_two_arguments(x):
3350
assert f(1, 3, c=3, d=5) == 12
3451

3552

36-
def test_four_arguments(x):
53+
def test_three_arguments():
54+
"""
55+
Check whether a future warning is produced if four
56+
positional arguments given.
57+
"""
58+
with tm.assert_produces_warning(FutureWarning):
59+
assert f(6, 3, 3) == 12
60+
61+
62+
def test_four_arguments():
3763
"""
3864
Check whether a future warning is produced if four
3965
positional arguments given.

0 commit comments

Comments
 (0)