Skip to content

Commit ab86bcc

Browse files
authored
Fix skipping entrypoints test (#618)
1 parent a7a698d commit ab86bcc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

numcodecs/tests/test_entrypoints_backport.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import importlib
1+
import importlib.util
22
import os.path
33
import sys
44
from multiprocessing import Process
@@ -7,7 +7,8 @@
77

88
import numcodecs.registry
99

10-
if not importlib.util.find_spec("importlib_metadata").loader: # pragma: no cover
10+
importlib_spec = importlib.util.find_spec("importlib_metadata")
11+
if importlib_spec is None or importlib_spec.loader is None: # pragma: no cover
1112
pytest.skip(
1213
"This test module requires importlib_metadata to be installed",
1314
allow_module_level=True,

0 commit comments

Comments
 (0)