File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -2072,10 +2072,8 @@ def test_unsorted_index_raises(self) -> None:
2072
2072
ds2 = ondisk .isel (dim1 = inds )
2073
2073
# Older versions of NetCDF4 raise an exception here, and if so we
2074
2074
# want to ensure we improve (that is, replace) the error message
2075
- try :
2075
+ with pytest . raises ( IndexError , match = "first by calling .load" ) :
2076
2076
_ = ds2 .randovar .values
2077
- except IndexError as err :
2078
- assert "first by calling .load" in str (err )
2079
2077
2080
2078
def test_setncattr_string (self ) -> None :
2081
2079
list_of_strings = ["list" , "of" , "strings" ]
Original file line number Diff line number Diff line change @@ -255,14 +255,10 @@ def test_concat(self):
255
255
256
256
def test_missing_methods (self ):
257
257
v = self .lazy_var
258
- try :
258
+ with pytest . raises ( NotImplementedError , match = "dask" ) :
259
259
v .argsort ()
260
- except NotImplementedError as err :
261
- assert "dask" in str (err )
262
- try :
260
+ with pytest .raises (NotImplementedError , match = "dask" ):
263
261
v [0 ].item ()
264
- except NotImplementedError as err :
265
- assert "dask" in str (err )
266
262
267
263
def test_univariate_ufunc (self ):
268
264
u = self .eager_var
You can’t perform that action at this time.
0 commit comments