Skip to content

Skip test_pyzstd when pyzstd cannot be imported#845

Merged
d-v-b merged 2 commits into
zarr-developers:mainfrom
d-v-b:fix/pyzstd-importorskip-i386
Jun 18, 2026
Merged

Skip test_pyzstd when pyzstd cannot be imported#845
d-v-b merged 2 commits into
zarr-developers:mainfrom
d-v-b:fix/pyzstd-importorskip-i386

Conversation

@d-v-b

@d-v-b d-v-b commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

On i386 (Alpine, Python 3.14), pyzstd 0.17+ delegates to the stdlib
compression.zstd module, which requires the _zstd C extension that is
not built on that platform. The hard top-level import pyzstd turned
this into a collection error, failing the entire test run.

Guard the import with pytest.importorskip so the module is skipped
instead of erroring when pyzstd is unavailable.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

[Description of PR]

TODO:

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • Docs build locally
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

On i386 (Alpine, Python 3.14), pyzstd 0.17+ delegates to the stdlib
compression.zstd module, which requires the _zstd C extension that is
not built on that platform. The hard top-level `import pyzstd` turned
this into a collection error, failing the entire test run.

Guard the import with pytest.importorskip so the module is skipped
instead of erroring when pyzstd is unavailable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (99566f0) to head (bc9b6b3).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #845   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines          901       901           
=========================================
  Hits           901       901           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b d-v-b merged commit 53e5157 into zarr-developers:main Jun 18, 2026
38 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