From 56a308d734f262fc9c9200b63f86af03ebb906e8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Thu, 18 Jun 2026 16:14:35 +0200 Subject: [PATCH] Skip test_pyzstd when pyzstd cannot be imported 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) --- tests/test_pyzstd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_pyzstd.py b/tests/test_pyzstd.py index e6df84a7..4474f580 100644 --- a/tests/test_pyzstd.py +++ b/tests/test_pyzstd.py @@ -2,8 +2,10 @@ import numpy as np import pytest -import pyzstd -from numcodecs.zstd import Zstd + +pyzstd = pytest.importorskip("pyzstd") + +from numcodecs.zstd import Zstd # noqa: E402 test_data = [ b"Hello World!",