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 66
77from pvlib import _deprecation
88
9+ import warnings
10+
911
1012@pytest .fixture
1113def renamed_kwarg_func ():
1214 """Returns a function decorated by renamed_kwarg_warning."""
15+
1316 @_deprecation .renamed_kwarg_warning (
1417 "0.1.0" , "old_kwarg" , "new_kwarg" , "0.2.0"
1518 )
@@ -21,8 +24,10 @@ def func(new_kwarg):
2124
2225def test_renamed_kwarg_warning (renamed_kwarg_func ):
2326 # 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
2631
2732 # assert a warning is raised when using the old kwarg
2833 with pytest .warns (Warning , match = "Parameter 'old_kwarg' has been renamed" ):
You can’t perform that action at this time.
0 commit comments