Skip to content

Commit

Permalink
Fix test/python/transpiler/test_preset_passmanagers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ElePT committed Oct 18, 2024
1 parent 6e8f506 commit 78ae60d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/python/transpiler/test_preset_passmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,15 +1316,19 @@ def test_default_optimization_level_target_first_pos_arg(self):
def test_with_no_backend(self, optimization_level):
"""Test a passmanager is constructed with no backend and optimization level."""
target = GenericBackendV2(num_qubits=7, coupling_map=LAGOS_CMAP, seed=42)
pm = generate_preset_pass_manager(
optimization_level,
coupling_map=target.coupling_map,
basis_gates=target.operation_names,
inst_map=target.instruction_schedule_map,
instruction_durations=target.instruction_durations,
timing_constraints=target.target.timing_constraints(),
target=target.target,
)
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The `target` parameter should be used instead",
):
pm = generate_preset_pass_manager(
optimization_level,
coupling_map=target.coupling_map,
basis_gates=target.operation_names,
inst_map=target.instruction_schedule_map,
instruction_durations=target.instruction_durations,
timing_constraints=target.target.timing_constraints(),
target=target.target,
)
self.assertIsInstance(pm, PassManager)

@data(0, 1, 2, 3)
Expand Down

0 comments on commit 78ae60d

Please sign in to comment.