Skip to content

Commit dcf2989

Browse files
committed
Make imports not optional
1 parent 1f5670f commit dcf2989

2 files changed

Lines changed: 3 additions & 16 deletions

File tree

numcodecs/tests/test_pyzstd.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
# Check Zstd against pyzstd package
2-
from typing import TYPE_CHECKING
32

43
import numpy as np
54
import pytest
5+
import pyzstd
66

7-
try:
8-
from numcodecs.zstd import Zstd
9-
except ImportError: # pragma: no cover
10-
pytest.skip("numcodecs.zstd not available", allow_module_level=True)
11-
12-
if TYPE_CHECKING: # pragma: no cover
13-
import pyzstd
14-
else:
15-
pyzstd = pytest.importorskip("pyzstd")
7+
from numcodecs.zstd import Zstd
168

179
test_data = [
1810
b"Hello World!",

numcodecs/tests/test_zstd.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
import numpy as np
55
import pytest
66

7-
try:
8-
from numcodecs.zstd import Zstd
9-
except ImportError: # pragma: no cover
10-
pytest.skip("numcodecs.zstd not available", allow_module_level=True)
11-
12-
137
from numcodecs.tests.common import (
148
check_backwards_compatibility,
159
check_config,
@@ -18,6 +12,7 @@
1812
check_err_encode_object_buffer,
1913
check_repr,
2014
)
15+
from numcodecs.zstd import Zstd
2116

2217
codecs = [
2318
Zstd(),

0 commit comments

Comments
 (0)