diff --git a/tests/conftest.py b/tests/conftest.py index fa4dc80..0433e3c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,21 +13,21 @@ NAME2BACKEND = { - "tensorflow": TensorflowBackend(), - "pytorch": PyTorchBackend(), - "jax": JaxBackend(), + "tensorflow": TensorflowBackend, + "pytorch": PyTorchBackend, + "jax": JaxBackend, } @pytest.fixture def backend(backend_name): - yield NAME2BACKEND[backend_name] + yield NAME2BACKEND[backend_name]() AVAILABLE_BACKENDS = [] for backend_name in BACKENDS: try: - _backend = NAME2BACKEND[backend_name] + _backend = NAME2BACKEND[backend_name]() AVAILABLE_BACKENDS.append(backend_name) except (ModuleNotFoundError, ImportError): pass diff --git a/tests/test_backends.py b/tests/test_backends.py index ca6df37..3fb1276 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -1,3 +1,5 @@ +import platform + import pytest from qiboml.backends import MetaBackend @@ -13,5 +15,6 @@ def test_metabackend_load_error(): def test_metabackend_list_available(): - available_backends = {"tensorflow": True, "pytorch": True, "jax": True} + tensorflow = False if platform.system() == "Windows" else True + available_backends = {"tensorflow": tensorflow, "pytorch": True, "jax": True} assert MetaBackend().list_available() == available_backends