Skip to content

chore(tests): move gzip mtime-comparison helper out of library code - #4326

Merged
d-v-b merged 2 commits into
zarr-developers:mainfrom
d-v-b:chore/move-gzip-test-helper
Sep 9, 2026
Merged

d-v-b merged 2 commits into
zarr-developers:mainfrom
d-v-b:chore/move-gzip-test-helper

Conversation

@d-v-b

@d-v-b d-v-b commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR moves a used-by-tests-only helper for GZIP streams into the tests directory. I think it's a self-merge kind of PR.

🤖 AI text below 🤖

Summary

_gzip_streams_equal_except_mtime was added to zarr.codecs.gzip by #4270 / #4296 as a comparator for gzip output whose 4-byte MTIME header field varies with encode time, but its only callers are tests/test_fused_pipeline.py and tests/test_codecs/test_gzip.py. This PR moves it into tests/conftest.py alongside the other shared test helpers (nan_equal, deep_nan_equal, Expect), renames it gzip_streams_equal_except_mtime to match its new neighbors, and updates both importers. The library module no longer carries a test-only function; the function's body and its RFC 1952 docstring are unchanged.

Found during the pre-release review for #4256.

For reviewers

The move is mechanical. The only judgement calls are the home (tests/conftest.py, which already exports helpers imported as from tests.conftest import ..., rather than the public src/zarr/testing/ package) and the dropped leading underscore.

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

TODO

  • Add unit tests and/or doctests in docstrings (n/a — moves a test helper)
  • Add docstrings and API docs for any new/modified user-facing classes and functions (n/a)
  • New/modified features documented in docs/user-guide/*.md (n/a)
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

`_gzip_streams_equal_except_mtime` was only used by tests but lived in
`zarr.codecs.gzip`. Move it to `tests/conftest.py` alongside the other
shared test helpers (`nan_equal`, `deep_nan_equal`), rename it to
`gzip_streams_equal_except_mtime`, and update both importers.

Assisted-by: ClaudeCode:claude-fable-5-1
Assisted-by: ClaudeCode:claude-fable-5-1
@d-v-b
d-v-b marked this pull request as ready for review September 9, 2026 12:12
@d-v-b
d-v-b merged commit 7db1c74 into zarr-developers:main Sep 9, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant