File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
from pvlib import _deprecation
8
8
9
+ import warnings
10
+
9
11
10
12
@pytest .fixture
11
13
def renamed_kwarg_func ():
12
14
"""Returns a function decorated by renamed_kwarg_warning."""
15
+
13
16
@_deprecation .renamed_kwarg_warning (
14
17
"0.1.0" , "old_kwarg" , "new_kwarg" , "0.2.0"
15
18
)
@@ -21,8 +24,10 @@ def func(new_kwarg):
21
24
22
25
def test_renamed_kwarg_warning (renamed_kwarg_func ):
23
26
# assert no warning is raised when using the new kwarg
24
- assert renamed_kwarg_func (new_kwarg = 1 ) == 1 # as keyword argument
25
- assert renamed_kwarg_func (1 ) == 1 # as positional argument
27
+ with warnings .catch_warnings ():
28
+ warnings .simplefilter ("error" )
29
+ assert renamed_kwarg_func (new_kwarg = 1 ) == 1 # as keyword argument
30
+ assert renamed_kwarg_func (1 ) == 1 # as positional argument
26
31
27
32
# assert a warning is raised when using the old kwarg
28
33
with pytest .warns (Warning , match = "Parameter 'old_kwarg' has been renamed" ):
You can’t perform that action at this time.
0 commit comments