Skip to content

Commit 11abad1

Browse files
committed
Include type in NotImplementedError
1 parent d9aa4f1 commit 11abad1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/zarr/abc/store.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ def with_read_only(self, read_only: bool = False) -> Store:
9797
-------
9898
A new store of the same type with the new read only attribute.
9999
"""
100-
raise NotImplementedError("with_read_only is not implemented for this store type.")
100+
raise NotImplementedError(
101+
f"with_read_only is not implemented for the {type(self)} store type."
102+
)
101103

102104
def __enter__(self) -> Self:
103105
"""Enter a context manager that will close the store upon exiting."""

src/zarr/testing/store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ async def test_with_read_only_store(self, open_kwargs: dict[str, Any]) -> None:
196196
except NotImplementedError:
197197
# Test that stores that do not implement with_read_only raise NotImplementedError with the correct message
198198
with pytest.raises(
199-
NotImplementedError, match="with_read_only is not implemented for this store type."
199+
NotImplementedError,
200+
match=f"with_read_only is not implemented for the {type(store)} store type.",
200201
):
201202
store.with_read_only(read_only=False)
202203

0 commit comments

Comments
 (0)