Skip to content

Commit 589e6f2

Browse files
committed
restore the assertWarns, waiting for Qiskit#12818
1 parent 87aae01 commit 589e6f2

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/python/primitives/test_backend_estimator.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,11 @@ def callback(msg):
390390

391391
bound_counter = CallbackPass("bound_pass_manager", callback)
392392
bound_pass = PassManager(bound_counter)
393-
estimator = BackendEstimator(
394-
backend=GenericBackendV2(num_qubits=5, seed=42), bound_pass_manager=bound_pass
395-
)
396-
_ = estimator.run(qc, op).result()
393+
with self.assertWarns(DeprecationWarning):
394+
estimator = BackendEstimator(
395+
backend=GenericBackendV2(num_qubits=5, seed=42), bound_pass_manager=bound_pass
396+
)
397+
_ = estimator.run(qc, op).result()
397398
expected = [
398399
"bound_pass_manager",
399400
]
@@ -412,10 +413,12 @@ def callback(msg): # pylint: disable=function-redefined
412413

413414
bound_counter = CallbackPass("bound_pass_manager", callback)
414415
bound_pass = PassManager(bound_counter)
415-
estimator = BackendEstimator(
416-
backend=GenericBackendV2(num_qubits=5, seed=42), bound_pass_manager=bound_pass
417-
)
418-
_ = estimator.run([qc, qc], [op, op]).result()
416+
with self.assertWarns(DeprecationWarning):
417+
estimator = BackendEstimator(
418+
backend=GenericBackendV2(num_qubits=5, seed=42),
419+
bound_pass_manager=bound_pass,
420+
)
421+
_ = estimator.run([qc, qc], [op, op]).result()
419422
expected = [
420423
"bound_pass_manager",
421424
"bound_pass_manager",

0 commit comments

Comments
 (0)