Skip to content

Commit

Permalink
fix tests for async=True
Browse files Browse the repository at this point in the history
  • Loading branch information
nonhermitian committed Oct 22, 2024
1 parent a816c89 commit d1ab2b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mthree/test/test_extra_cals.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def test_save_cals(tmp_path):
cal_file = tmp_path / "cal.json"
mit = mthree.M3Mitigation(backend)
mit.cals_from_system(cals_file=cal_file)
_ = mit.single_qubit_cals #Force waiting since async=True by default
with open(cal_file, "r", encoding="utf-8") as fd:
cals = np.array(orjson.loads(fd.read())["cals"], dtype=np.float32)
assert np.array_equal(mit.single_qubit_cals, cals)
Expand All @@ -82,6 +83,7 @@ def test_load_cals(tmp_path):
backend = FakeAthens()
mit = mthree.M3Mitigation(backend)
mit.cals_from_system(cals_file=cal_file)
_ = mit.single_qubit_cals #Force waiting since async=True by default
new_mit = mthree.M3Mitigation(backend)
new_mit.cals_from_file(cal_file)
assert np.array_equal(mit.single_qubit_cals, new_mit.single_qubit_cals)
1 change: 1 addition & 0 deletions mthree/test/test_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_load_cals_from_file():
raw_counts = backend.run(qc).result().get_counts()
mit = mthree.M3Mitigation(backend)
mit.cals_from_system(cals_file="cals.json")
_ = mit.single_qubit_cals

mit2 = mthree.M3Mitigation()
mit2.cals_from_file(cals_file="cals.json")
Expand Down

0 comments on commit d1ab2b6

Please sign in to comment.