Skip to content

Commit 626fa06

Browse files
committed
fix pytest syntax
1 parent dc711d9 commit 626fa06

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

xarray/tests/test_backends.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ def test_chunk_encoding_with_dask(self):
18671867
# should fail if encoding["chunks"] clashes with dask_chunks
18681868
badenc = ds.chunk({"x": 4})
18691869
badenc.var1.encoding["chunks"] = (6,)
1870-
with raises_regex(NotImplementedError, "named 'var1' would overlap"):
1870+
with pytest.raises(NotImplementedError, match=r"named 'var1' would overlap"):
18711871
with self.roundtrip(badenc) as actual:
18721872
pass
18731873

@@ -1877,13 +1877,15 @@ def test_chunk_encoding_with_dask(self):
18771877
pass
18781878

18791879
badenc.var1.encoding["chunks"] = (2,)
1880-
with raises_regex(NotImplementedError, "Specified Zarr chunk encoding"):
1880+
with pytest.raises(NotImplementedError, match=r"Specified Zarr chunk encoding"):
18811881
with self.roundtrip(badenc) as actual:
18821882
pass
18831883

18841884
badenc = badenc.chunk({"x": (3, 3, 6)})
18851885
badenc.var1.encoding["chunks"] = (3,)
1886-
with raises_regex(NotImplementedError, "incompatible with this encoding"):
1886+
with pytest.raises(
1887+
NotImplementedError, match=r"incompatible with this encoding"
1888+
):
18871889
with self.roundtrip(badenc) as actual:
18881890
pass
18891891

@@ -1906,7 +1908,7 @@ def test_chunk_encoding_with_dask(self):
19061908
# TODO: remove this failure once syncronized overlapping writes are
19071909
# supported by xarray
19081910
ds_chunk4["var1"].encoding.update({"chunks": 5})
1909-
with raises_regex(NotImplementedError, "named 'var1' would overlap"):
1911+
with pytest.raises(NotImplementedError, match=r"named 'var1' would overlap"):
19101912
with self.roundtrip(ds_chunk4) as actual:
19111913
pass
19121914
# override option

0 commit comments

Comments
 (0)