Skip to content

Commit bbb9879

Browse files
committed
monkeypatch to always work with a empty registry
1 parent f641534 commit bbb9879

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_metadata/test_v3.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,15 @@ async def test_special_float_fill_values(fill_value: str) -> None:
326326
assert d["fill_value"] == "-Infinity"
327327

328328

329-
def test_parse_codecs_unknown_codec_raises() -> None:
329+
def test_parse_codecs_unknown_codec_raises(monkeypatch: pytest.MonkeyPatch) -> None:
330+
from collections import defaultdict
331+
332+
import zarr.registry
333+
from zarr.registry import Registry
334+
335+
# to make sure the codec is always unknown (not sure if that's necessary)
336+
monkeypatch.setattr(zarr.registry, "__codec_registries", defaultdict(Registry))
337+
330338
codecs = [{"name": "unknown"}]
331339
with pytest.raises(UnknownCodecError):
332340
parse_codecs(codecs)

0 commit comments

Comments
 (0)