From dab3e320c77f2b0542d057c986e9e79b63df22eb Mon Sep 17 00:00:00 2001 From: Coull Date: Wed, 22 May 2024 10:11:34 -0700 Subject: [PATCH] fix: job fixture for endpoint support --- test/integ_tests/conftest.py | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/test/integ_tests/conftest.py b/test/integ_tests/conftest.py index 80a8f5c8f..7aa772c8d 100644 --- a/test/integ_tests/conftest.py +++ b/test/integ_tests/conftest.py @@ -171,29 +171,21 @@ def job_failed_name(request): @pytest.fixture(scope="session", autouse=True) def completed_quantum_job(job_completed_name): - job_arn = ( - [ - job["jobArn"] - for job in boto3.client("braket").search_jobs(filters=[])["jobs"] - if job["jobName"] == job_completed_name - ][0] - if os.getenv("JOBS_STARTED") - else None - ) - - return AwsQuantumJob(arn=job_arn) if os.getenv("JOBS_STARTED") else None + job_arn = [ + job["jobArn"] + for job in boto3.client("braket").search_jobs(filters=[])["jobs"] + if job["jobName"] == job_completed_name + ][0] + return AwsQuantumJob(arn=job_arn) @pytest.fixture(scope="session", autouse=True) def failed_quantum_job(job_failed_name): - job_arn = ( - [ - job["jobArn"] - for job in boto3.client("braket").search_jobs(filters=[])["jobs"] - if job["jobName"] == job_failed_name - ][0] - if os.getenv("JOBS_STARTED") - else None - ) + job_arn = [ + job["jobArn"] + for job in boto3.client("braket").search_jobs(filters=[])["jobs"] + if job["jobName"] == job_failed_name + ][0] + + return AwsQuantumJob(arn=job_arn) - return AwsQuantumJob(arn=job_arn) if os.getenv("JOBS_STARTED") else None