diff --git a/test/integ_tests/conftest.py b/test/integ_tests/conftest.py index 2962c2048..2a56d8074 100644 --- a/test/integ_tests/conftest.py +++ b/test/integ_tests/conftest.py @@ -161,16 +161,22 @@ def job_failed_name(request): @pytest.fixture(scope="session", autouse=True) -def completed_quantum_job(aws_session, job_completed_name): - account = boto3.client("sts").get_caller_identity().get("Account") - region = aws_session.region - job = AwsQuantumJob(arn=f"arn:aws:braket:{region}:{account}:job/{job_completed_name}") - return job +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] + + return AwsQuantumJob(arn=job_arn) @pytest.fixture(scope="session", autouse=True) -def failed_quantum_job(aws_session, job_failed_name): - account = boto3.client("sts").get_caller_identity().get("Account") - region = aws_session.region - job = AwsQuantumJob(arn=f"arn:aws:braket:{region}:{account}:job/{job_failed_name}") - return job +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] + + return AwsQuantumJob(arn=job_arn)