File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -155,21 +155,21 @@ def __array__(self):
155
155
a = WarningVariable ("x" , [1 ])
156
156
b = WarningVariable ("x" , [2 ])
157
157
158
- # elevate warnings to errors
159
- warnings .filterwarnings ("error" )
160
-
161
158
with warnings .catch_warnings (record = True ) as w :
159
+ warnings .filterwarnings ("error" )
160
+ # elevate warnings to errors
162
161
with pytest .raises (AssertionError ):
163
162
getattr (xr .testing , func )(a , b )
164
163
165
164
assert len (w ) > 0
166
165
167
- # ensure warnings still raise outside of assert_*
168
- with pytest .raises (UserWarning ):
169
- warnings .warn ("test" )
166
+ # ensure warnings still raise outside of assert_*
167
+ with pytest .raises (UserWarning ):
168
+ warnings .warn ("test" )
170
169
170
+ # ensure warnings stay ignored in assert_*
171
171
with warnings .catch_warnings (record = True ) as w :
172
- # elevate warnings to errors
172
+ # ignore warnings
173
173
warnings .filterwarnings ("ignore" )
174
174
with pytest .raises (AssertionError ):
175
175
getattr (xr .testing , func )(a , b )
You can’t perform that action at this time.
0 commit comments