From 6d8766494d132d341a6dec7f58c844269d4ac924 Mon Sep 17 00:00:00 2001 From: Jessie Yu Date: Wed, 26 Oct 2022 11:28:53 -0400 Subject: [PATCH] Remove log text checking (#591) * remove log checking * fix lint --- test/integration/test_estimator.py | 2 +- test/integration/test_job.py | 5 +++-- test/integration/test_options.py | 10 ++++++---- test/integration/test_results.py | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/test/integration/test_estimator.py b/test/integration/test_estimator.py index efd01498a..c4adf80f0 100644 --- a/test/integration/test_estimator.py +++ b/test/integration/test_estimator.py @@ -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()) diff --git a/test/integration/test_job.py b/test/integration/test_job.py index b133dd281..9d2764ccf 100644 --- a/test/integration/test_job.py +++ b/test/integration/test_job.py @@ -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): diff --git a/test/integration/test_options.py b/test/integration/test_options.py index 9b1f43fd2..6e0286b83 100644 --- a/test/integration/test_options.py +++ b/test/integration/test_options.py @@ -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) diff --git a/test/integration/test_results.py b/test/integration/test_results.py index 91b71f31f..7ddf1a456 100644 --- a/test/integration/test_results.py +++ b/test/integration/test_results.py @@ -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, )