Skip to content

Commit

Permalink
add test and reno
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Feb 23, 2024
1 parent 032271e commit 117628d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
deprecations:
- |
In a future release, ``backend`` will be a required argument to :class:`qiskit_ibm_runtime.Session`
and :class:`qiskit_ibm_runtime.Batch` when using the ``ibm_cloud`` channel.
7 changes: 7 additions & 0 deletions test/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def test_missing_backend(self):
with self.assertRaises(ValueError):
Session(service=service)

def test_missing_backend_cloud_warning(self):
"""Test warning if no backend provided on cloud channel."""
service = MagicMock()
service.channel = "ibm_cloud"
with self.assertWarns(UserWarning):
Session(service=service)

def test_passing_ibm_backend(self):
"""Test passing in IBMBackend instance."""
backend = MagicMock(spec=IBMBackend)
Expand Down

0 comments on commit 117628d

Please sign in to comment.