Skip to content

Commit 98a0a19

Browse files
committed
TST: use pytest.importorskip
1 parent bdb4df0 commit 98a0a19

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/test_at.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ def array(request: pytest.FixtureRequest) -> Array:
4040
x = np.asarray([10.0, 20.0, 30.0])
4141
x.flags.writeable = False
4242
else:
43-
library_name = library.value
44-
try:
45-
lib = import_module(library_name)
46-
except ImportError:
47-
pytest.skip(f"{library_name} is not installed")
48-
x = lib.asarray([10.0, 20.0, 30.0])
43+
xp = pytest.importorskip(library.value)
44+
x = xp.asarray([10.0, 20.0, 30.0])
4945
return x
5046

5147

0 commit comments

Comments
 (0)