Skip to content

Commit d8845df

Browse files
authored
Update test_deprecate_nonkeyword_args.py
Fix tests for the deprecate_nonkeyword_args decorator
1 parent ed60189 commit d8845df

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

pandas/tests/util/test_deprecate_nonkeyword_args.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ def test_two_arguments():
2020
Check whether no warnings are displayed if `some_func` called with
2121
two positional arguments
2222
"""
23-
with tm.assert_produces_warning(FutureWarning):
24-
s = some_func(1, 2)
23+
s = some_func(1, 2)
2524
assert s == 3
2625

2726

@@ -30,21 +29,29 @@ def test_two_and_two_arguments():
3029
Check whether no warnings are displayed if `some_func` called with
3130
two positional arguments and two keyword arguments
3231
"""
33-
with tm.assert_produces_warning(FutureWarning):
34-
s = some_func(1, 2, c=3, d=4)
35-
assert s == 10
32+
s = some_func(1, 2, c=3, d=6)
33+
assert s == 12
3634

3735

3836
def test_two_and_one_arguments():
3937
"""
4038
Check whether no warnings are displayed if `some_func` called with
4139
two positional arguments and one keyword argument
4240
"""
43-
with tm.assert_produces_warning(FutureWarning):
44-
s = some_func(1, 2, d=12)
41+
s = some_func(1, 2, d=12)
4542
assert s == 15
4643

4744

45+
def test_three_arguments():
46+
"""
47+
Check whether a warning is displayed if `some_func` called with
48+
three positional arguments
49+
"""
50+
with tm.assert_produces_warning(FutureWarning):
51+
s = some_func(1, 2, 5)
52+
assert s == 8
53+
54+
4855
def test_four_arguments():
4956
"""
5057
Check whether a warning is displayed if `some_func` called with

0 commit comments

Comments
 (0)