From 9bd42299d373ca5a466770d1cf9d960491d81f4b Mon Sep 17 00:00:00 2001 From: Alec Edgington <54802828+cqc-alec@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:40:55 +0100 Subject: [PATCH] [bugfix] [test] Fix integration tests and handling of null bit list (#212) --- pytket/extensions/quantinuum/backends/quantinuum.py | 2 ++ tests/integration/backend_test.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pytket/extensions/quantinuum/backends/quantinuum.py b/pytket/extensions/quantinuum/backends/quantinuum.py index df1b7674..39305d60 100644 --- a/pytket/extensions/quantinuum/backends/quantinuum.py +++ b/pytket/extensions/quantinuum/backends/quantinuum.py @@ -587,6 +587,8 @@ def get_results_selection(handle: ResultHandle) -> Any: if s == "": return None bits = json.loads(s) + if bits is None: + return None assert all(isinstance(name, str) and isinstance(idx, int) for name, idx in bits) return bits diff --git a/tests/integration/backend_test.py b/tests/integration/backend_test.py index 084dd969..bcb4ac26 100644 --- a/tests/integration/backend_test.py +++ b/tests/integration/backend_test.py @@ -552,7 +552,7 @@ def test_submission_with_group( c.measure_all() c = b.get_compiled_circuit(c) n_shots = 10 - shots = b.run_circuit(c, n_shots=n_shots, group="DEFAULT").get_shots() # type: ignore + shots = b.run_circuit(c, n_shots=n_shots, group="Default - UK").get_shots() # type: ignore assert all(q[0] == q[1] for q in shots) @@ -770,7 +770,7 @@ def test_allow_2q_gate_rebase(authenticated_quum_backend: QuantinuumBackend) -> r = b.get_results(h)[0] shots = r.get_shots() assert len(shots) == 1 - assert len(shots[0]) == 1 + assert len(shots[0]) == 2 @pytest.mark.skipif(skip_remote_tests, reason=REASON)