Skip to content

Commit

Permalink
Deprecate legacy provider interface (Qiskit/qiskit#6337)
Browse files Browse the repository at this point in the history
* Deprecate legacy provider interface

In the 0.16.0 release we added a new versioned providers interface that
included a V1 version of the Backend, Job, and Provider classes. Since
then we've updated and unified almost all of the providers that exist to
use the current interface. Having everything use the new interface means
that we're now able to both evolve the interface in a controlled manner
uniformly and also deprecate the legacy interface to signal to any other
providers out there (especially those we don't maintain) that we'll only
be supporting the versioned interface moving forward.

* Fix lint

* Run black

* Add deprecation warning assertion on legacy backends tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mtreinish and mergify[bot] authored Jun 9, 2021
1 parent 5cd5d4c commit 08c9ea0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/integration/test_fake_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ def test_circuit_on_fake_legacy_backend(self, backend, optimization_level):
"Unable to run fake_backend %s without qiskit-aer"
% backend.configuration().backend_name
)
job = execute(
self.circuit,
backend,
optimization_level=optimization_level,
seed_simulator=42,
seed_transpiler=42,
)
result = job.result()
with self.assertWarns(DeprecationWarning):
job = execute(
self.circuit,
backend,
optimization_level=optimization_level,
seed_simulator=42,
seed_transpiler=42,
)
result = job.result()
counts = result.get_counts()
max_count = max(counts.items(), key=operator.itemgetter(1))[0]
self.assertEqual(max_count, "11")
Expand Down

0 comments on commit 08c9ea0

Please sign in to comment.