Skip to content

Commit

Permalink
Remove log text checking (#591)
Browse files Browse the repository at this point in the history
* remove log checking

* fix lint
  • Loading branch information
jyu00 authored Oct 26, 2022
1 parent 2ae8a27 commit 6d87664
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/integration/test_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _callback(job_id_, result_):
with Session(service, self.backend) as session:
estimator = Estimator(session=session)
job = estimator.run(
circuits=[bell] * 20, observables=[obs] * 20, callback=_callback
circuits=[bell] * 40, observables=[obs] * 40, callback=_callback
)
result = job.result()
self.assertTrue((result.values == ws_result[-1].values).all())
Expand Down
5 changes: 3 additions & 2 deletions test/integration/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ def test_run_program_failed(self, service):
API_TO_JOB_ERROR_MESSAGE["FAILED"].format(job.job_id(), job_result_raw),
job.error_message(),
)
with self.assertRaises(RuntimeJobFailureError) as err_cm:
with self.assertRaises(RuntimeJobFailureError):
job.result()
self.assertIn("KeyError", str(err_cm.exception))
# TODO: Re-enable when ntc-1651 is fixed
# self.assertIn("KeyError", str(err_cm.exception))

@run_integration_test
def test_run_program_failed_ran_too_long(self, service):
Expand Down
10 changes: 6 additions & 4 deletions test/integration/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ def test_simulator_transpile(self, service):
sampler = Sampler(options=opt)
job1 = sampler.run(circ)
self.log.info("Runtime job %s submitted.", job1.job_id())
with self.assertRaises(RuntimeJobFailureError) as err:
with self.assertRaises(RuntimeJobFailureError):
job1.result()
self.assertIn("TranspilerError", err.exception.message)
# TODO: Re-enable when ntc-1651 is fixed
# self.assertIn("TranspilerError", err.exception.message)

estimator = Estimator(options=opt)
job2 = estimator.run(circ, observables=obs)
with self.assertRaises(RuntimeJobFailureError) as err:
with self.assertRaises(RuntimeJobFailureError):
job2.result()
self.assertIn("TranspilerError", err.exception.message)
# TODO: Re-enable when ntc-1651 is fixed
# self.assertIn("TranspilerError", err.exception.message)
5 changes: 3 additions & 2 deletions test/integration/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,12 @@ def result_callback(job_id, result):
final_it = result["iteration"]

final_it = 0
iterations = 3
iterations = 10
inputs = {"iterations": iterations, "sleep_per_iteration": 3}
with self.assertLogs("qiskit_ibm_runtime", level="WARNING") as err_cm:
job = self._run_program(
service,
iterations=iterations,
inputs=inputs,
interim_results="foo",
callback=result_callback,
)
Expand Down

0 comments on commit 6d87664

Please sign in to comment.