Skip to content

Commit 89d04c6

Browse files
gh-915: Fail tests if array backend not found (#917)
Co-authored-by: Patrick J. Roddy <patrickjamesroddy@gmail.com>
1 parent 3fc348f commit 89d04c6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/fixtures/array_backends.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from __future__ import annotations
99

10-
import contextlib
1110
import importlib.metadata
1211
import os
1312
from typing import TYPE_CHECKING
@@ -89,14 +88,9 @@ def _import_and_add_jax(xp_available_backends: dict[str, ModuleType]) -> None:
8988
_import_and_add_jax(xp_available_backends)
9089
# if all, try importing every backend
9190
elif ARRAY_BACKEND == "all":
92-
with contextlib.suppress(ImportError):
93-
_import_and_add_numpy(xp_available_backends)
94-
95-
with contextlib.suppress(ImportError):
96-
_import_and_add_array_api_strict(xp_available_backends)
97-
98-
with contextlib.suppress(ImportError):
99-
_import_and_add_jax(xp_available_backends)
91+
_import_and_add_numpy(xp_available_backends)
92+
_import_and_add_array_api_strict(xp_available_backends)
93+
_import_and_add_jax(xp_available_backends)
10094
else:
10195
msg = f"unsupported array backend: {ARRAY_BACKEND}"
10296
raise ValueError(msg)

0 commit comments

Comments
 (0)