Skip to content

Commit

Permalink
Fix expected_regex in transpile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ElePT authored Jul 31, 2024
1 parent 8ba5437 commit cd5d8ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions test/python/pulse/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def get_sched(qubit_idx: [int], backend):
qc.append(circuit.library.U2Gate(0, pi / 2), [idx])
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled = compiler.transpile(qc, backend=backend, optimization_level=1)
return compiler.schedule(transpiled, backend)
Expand All @@ -793,7 +793,7 @@ def get_sched(qubit_idx: [int], backend):
single_u2_qc.append(circuit.library.U2Gate(0, pi / 2), [1])
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
single_u2_qc = compiler.transpile(single_u2_qc, self.backend, optimization_level=1)
single_u2_sched = compiler.schedule(single_u2_qc, self.backend)
Expand Down Expand Up @@ -822,7 +822,7 @@ def get_sched(qubit_idx: [int], backend):
triple_u2_qc.append(circuit.library.U2Gate(0, pi / 2), [0])
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
triple_u2_qc = compiler.transpile(triple_u2_qc, self.backend, optimization_level=1)
align_left_reference = compiler.schedule(triple_u2_qc, self.backend, method="alap")
Expand Down
16 changes: 8 additions & 8 deletions test/python/transpiler/test_pulse_gate_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_transpile_with_bare_backend(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, initial_layout=[0, 1])

Expand Down Expand Up @@ -118,7 +118,7 @@ def test_transpile_with_custom_basis_gate(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, initial_layout=[0, 1])

Expand Down Expand Up @@ -187,7 +187,7 @@ def test_transpile_with_instmap(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, inst_map=instmap, initial_layout=[0, 1])

Expand Down Expand Up @@ -227,7 +227,7 @@ def test_transpile_with_custom_gate(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, basis_gates=["my_gate"], initial_layout=[0, 1])

Expand Down Expand Up @@ -267,7 +267,7 @@ def test_transpile_with_parameterized_custom_gate(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, basis_gates=["my_gate"], initial_layout=[0])

Expand Down Expand Up @@ -308,7 +308,7 @@ def test_transpile_with_multiple_circuits(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qcs = transpile(circs, backend, basis_gates=["my_gate"], initial_layout=[0])

Expand Down Expand Up @@ -345,7 +345,7 @@ def test_multiple_instructions_with_different_parameters(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, basis_gates=["my_gate"], initial_layout=[0])

Expand Down Expand Up @@ -378,7 +378,7 @@ def test_transpile_with_different_qubit(self):

with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
transpiled_qc = transpile(qc, backend, initial_layout=[3])

Expand Down
8 changes: 4 additions & 4 deletions test/python/transpiler/test_vf2_post_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_2q_circuit_5q_backend(self):
circuit.cx(qr[1], qr[0]) # qr1 -> qr0
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
tqc = transpile(circuit, backend, layout_method="dense")
initial_layout = tqc._layout
Expand Down Expand Up @@ -282,7 +282,7 @@ def test_2q_circuit_5q_backend_max_trials_v1(self):
circuit.cx(qr[1], qr[0]) # qr1 -> qr0
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
tqc = transpile(circuit, backend, layout_method="dense")
initial_layout = tqc._layout
Expand Down Expand Up @@ -693,7 +693,7 @@ def test_best_mapping_ghz_state_full_device_multiple_qregs_v1(self):
qc.measure_all()
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
tqc = transpile(qc, backend, seed_transpiler=self.seed, layout_method="trivial")
initial_layout = tqc._layout
Expand Down Expand Up @@ -743,7 +743,7 @@ def test_2q_circuit_5q_backend_v1(self):
circuit.cx(qr[1], qr[0]) # qr1 -> qr0
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="The function transpile will stop supporting BackendV1",
expected_regex="The `transpile` function will stop supporting inputs of type `BackendV1`",
):
tqc = transpile(circuit, backend, layout_method="dense")
initial_layout = tqc._layout
Expand Down

0 comments on commit cd5d8ef

Please sign in to comment.