Skip to content

Commit

Permalink
Suppress PulseSimulator deprecation warning in tests (Qiskit#9767)
Browse files Browse the repository at this point in the history
In the recently released qiskit-aer 0.12.0 the PulseSimulator backend
(used as its name implies to simulate pulse schedules) was deprecated in
favor of the actively maintained qiskit-dynamcis package. This
deprecation is causing test failures when running our test suite with
qiskit-aer installed because a single test was opportunistically using
the PulseSimulator backend when aer was installed. This commit adds an
assertion to catch the DeprecationWarning and adds a comment to rewrite
the test to use dynamics. Although we may not wish to add the optional
bidirectional dependency for a single test, in which case we should just
delete the test. But that is a discussion for a follow up PR when CI is
not blocked by an upstream package's release. This commit is just a
short term workaround to unblock forward progress.
  • Loading branch information
mtreinish committed Mar 9, 2023
1 parent fa7ac68 commit d272919
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/python/pulse/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ def test_execute_block(self):
pulse.acquire(50, pulse.AcquireChannel(0), pulse.MemorySlot(0))

backend = FakeArmonk()
test_result = backend.run(sched_block).result()
# TODO: Rewrite test to simulate with qiskit-dynamics
with self.assertWarns(DeprecationWarning):
test_result = backend.run(sched_block).result()
self.assertDictEqual(test_result.get_counts(), {"0": 1024})


Expand Down

0 comments on commit d272919

Please sign in to comment.