-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
|
||
def test_zarr3_import(): | ||
ERROR_MESSAGE_MATCH = "zarr 3.0.0 or later.*" | ||
|
||
try: | ||
import zarr | ||
except ImportError: | ||
pass | ||
|
||
if zarr is None or zarr.__version__ < "3.0.0": | ||
with pytest.raises(ImportError): | ||
if zarr.__version__ < "3.0.0": | ||
with pytest.raises(ImportError, match=ERROR_MESSAGE_MATCH): | ||
import numcodecs._zarr3 # noqa: F401 | ||
except ImportError: | ||
with pytest.raises(ImportError, match=ERROR_MESSAGE_MATCH): | ||
import numcodecs._zarr3 # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters