From 79b9b075c82dc9ebb4e5764b8c9f0ed371b1cdb0 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 22 Aug 2024 12:47:47 +0200 Subject: [PATCH] test: Catch errors in uniform and non-redundant way --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 87ac46a011..538ed7a1e5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -43,13 +43,13 @@ def get_backend(backend_name): AVAILABLE_BACKENDS.append(backend_name) if _backend.supports_multigpu: # pragma: no cover MULTIGPU_BACKENDS.append(backend_name) - except (ModuleNotFoundError, ImportError): + except ImportError: pass try: get_backend("qulacs") QULACS_INSTALLED = True -except ModuleNotFoundError: +except ImportError: QULACS_INSTALLED = False