Skip to content

Commit

Permalink
fix: job fixture for endpoint support
Browse files Browse the repository at this point in the history
  • Loading branch information
Coull committed May 22, 2024
1 parent 035409a commit dab3e32
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions test/integ_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dab3e32

Please sign in to comment.