Skip to content

Commit 7a0c40b

Browse files
committed
Apply coderabbit suggestions
1 parent adaefa9 commit 7a0c40b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/compilation/test_predictor_rl.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def test_register_action() -> None:
150150
"fom",
151151
["expected_fidelity", "estimated_success_probability"],
152152
)
153-
def test_approx_reward_paths_use_cached_per_gate_maps(monkeypatch: pytest.MonkeyPatch, fom: figure_of_merit) -> None:
153+
def test_approx_reward_paths_use_cached_per_gate_maps(fom: figure_of_merit) -> None:
154154
"""Ensure approx reward path runs and uses cached per-basis-gate calibration maps.
155155
156156
We don't test exact numeric values (backend-dependent), only that:
@@ -162,10 +162,7 @@ def test_approx_reward_paths_use_cached_per_gate_maps(monkeypatch: pytest.Monkey
162162
device = get_device("ibm_heron_133")
163163
predictor = Predictor(figure_of_merit=fom, device=device)
164164

165-
# Force approx path
166-
monkeypatch.setattr(predictor.env, "_is_native_and_mapped", lambda _qc: False)
167-
168-
val, kind = predictor.env.calculate_reward(qc=qc, mode="auto")
165+
val, kind = predictor.env.calculate_reward(qc=qc, mode="approx")
169166
assert kind == "approx"
170167
assert 0.0 <= val <= 1.0
171168

0 commit comments

Comments
 (0)