From f8bbe1b4536853bd2e0e6d4b500a82165fe6b2fe Mon Sep 17 00:00:00 2001 From: David Stansby Date: Mon, 28 Oct 2024 22:23:49 +0000 Subject: [PATCH] Fix skipping entrypoints test --- numcodecs/tests/test_entrypoints_backport.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/numcodecs/tests/test_entrypoints_backport.py b/numcodecs/tests/test_entrypoints_backport.py index 21f245aa..7e1c32bc 100644 --- a/numcodecs/tests/test_entrypoints_backport.py +++ b/numcodecs/tests/test_entrypoints_backport.py @@ -1,4 +1,4 @@ -import importlib +import importlib.util import os.path import sys from multiprocessing import Process @@ -7,7 +7,8 @@ import numcodecs.registry -if not importlib.util.find_spec("importlib_metadata").loader: # pragma: no cover +importlib_spec = importlib.util.find_spec("importlib_metadata") +if importlib_spec is None or importlib_spec.loader is None: # pragma: no cover pytest.skip( "This test module requires importlib_metadata to be installed", allow_module_level=True,