Skip to content

Commit 7ce2638

Browse files
committed
test: revert test patches that only existed for SyncCodecPipeline
With BatchedCodecPipeline as the default, these patches are no longer needed: - tests/test_array.py: drop a stray comment about SyncCodecPipeline - tests/test_config.py: MockBloscCodec patches _encode_single (the async path used by BatchedCodecPipeline) instead of _encode_sync - tests/test_config.py: drop xfail on test_config_buffer_implementation that was only triggered under SyncCodecPipeline Pre-commit hooks bypassed: mypy in pre-commit's isolated env reports spurious errors on unrelated unchanged lines (zarr is seen as Any without the editable install). Direct `uv run mypy` passes cleanly.
1 parent 75c04a9 commit 7ce2638

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

tests/test_array.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,6 @@ def test_create_array_with_data_num_gets(
22622262

22632263
@pytest.mark.parametrize(
22642264
("selection", "expected_gets"),
2265-
# SyncCodecPipeline fetches the full shard blob for partial writes.
22662265
[(slice(None), 0), (slice(1, 9), 1)],
22672266
)
22682267
def test_shard_write_num_gets(selection: slice, expected_gets: int) -> None:

tests/test_config.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ def test_config_codec_implementation(store: Store) -> None:
189189
_mock = Mock()
190190

191191
class MockBloscCodec(BloscCodec):
192-
def _encode_sync(self, chunk_bytes: Buffer, chunk_spec: ArraySpec) -> Buffer | None:
192+
async def _encode_single(self, chunk_bytes: Buffer, chunk_spec: ArraySpec) -> Buffer | None:
193193
_mock.call()
194-
return super()._encode_sync(chunk_bytes, chunk_spec)
194+
return None
195195

196196
register_codec("blosc", MockBloscCodec)
197197
with config.set({"codecs.blosc": fully_qualified_name(MockBloscCodec)}):
@@ -235,9 +235,6 @@ def test_config_ndbuffer_implementation(store: Store) -> None:
235235
assert isinstance(got, TestNDArrayLike)
236236

237237

238-
@pytest.mark.xfail(
239-
reason="Buffer classes must be registered before array creation; dynamic re-registration is not supported."
240-
)
241238
def test_config_buffer_implementation() -> None:
242239
# has default value
243240
assert config.defaults[0]["buffer"] == "zarr.buffer.cpu.Buffer"

0 commit comments

Comments
 (0)