Skip to content

Commit

Permalink
fix: fix metabackend test and list_available
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Apr 25, 2024
1 parent 033202f commit 3ddd43a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/qibolab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def list_available(self) -> dict:
available_platforms[platform] = True
except:
available_platforms[platform] = False
if len(available_platforms):
if len(available_platforms) == 0:
raise_error(
RuntimeError,
f"No valid platform found in the QIBOLAB_PLATFORMS directory: {os.environ.get(PLATFORMS)}. Please make sure that each platform has its corresponding `platform.py` file.",
Expand Down
6 changes: 4 additions & 2 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import warnings
from pathlib import Path

import numpy as np
import pytest
Expand Down Expand Up @@ -190,5 +191,6 @@ def test_superposition_for_all_qubits(connected_backend):
# TODO: test_circuit_result_representation


def test_metabackend(connected_backend):
assert MetaBackend().list_available()[connected_backend]
def test_metabackend():
available_platforms = {d.name: True for d in Path("tests/dummy_qrc/").iterdir()}
assert MetaBackend().list_available() == available_platforms

0 comments on commit 3ddd43a

Please sign in to comment.