Skip to content

Commit 9059135

Browse files
committed
Match error message
1 parent 0d6eccf commit 9059135

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/zarr/storage/_local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __init__(self, root: Path | str, *, read_only: bool = False) -> None:
9696
root = Path(root)
9797
if not isinstance(root, Path):
9898
raise TypeError(
99-
f'"root" must be a string or Path instance. Got an object with type {type(root)} instead.'
99+
f"'root' must be a string or Path instance. Got an instance of {type(root)} instead."
100100
)
101101
self.root = root
102102

tests/test_store/test_local.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def test_invalid_root_raises(self):
5959
"""
6060
Test that a TypeError is raised when a non-str/Path type is used for the `root` argument
6161
"""
62-
with pytest.raises(TypeError):
62+
with pytest.raises(
63+
TypeError,
64+
match=r"'root' must be a string or Path instance. Got an instance of <class 'int'> instead.",
65+
):
6366
LocalStore(root=0)
6467

6568
async def test_get_with_prototype_default(self, store: LocalStore):

0 commit comments

Comments
 (0)