Skip to content

Commit

Permalink
keep test
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Dec 7, 2023
1 parent d0a1ab5 commit 941abb3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/integration/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ def test_session_from_id(self, service):
job = sampler.run(ReferenceCircuits.bell(), shots=400)
self.assertEqual(session_id, job.session_id)

@run_integration_test
def test_session_no_backend(self, service):
"""Test session without passing in backend."""
if self.dependencies.channel == "ibm_quantum":
self.skipTest("Not supported on ibm_quantum")
with Session(service) as session:
sampler = Sampler(session=session)
job1 = sampler.run(ReferenceCircuits.bell(), shots=400)
job2 = sampler.run(ReferenceCircuits.bell(), shots=400)
self.assertTrue(job1.backend())
self.assertTrue(job2.backend())
self.assertEqual(job1.backend().name, job2.backend().name)


class TestBackendRunInSession(IBMIntegrationTestCase):
"""Integration tests for Backend.run in Session."""
Expand Down

0 comments on commit 941abb3

Please sign in to comment.