Skip to content

Commit 1438528

Browse files
AbeCoullCoull
andauthored
fix: job fixture for endpoint support (#978)
Co-authored-by: Coull <[email protected]>
1 parent 035409a commit 1438528

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

test/integ_tests/conftest.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -171,29 +171,21 @@ def job_failed_name(request):
171171

172172
@pytest.fixture(scope="session", autouse=True)
173173
def completed_quantum_job(job_completed_name):
174-
job_arn = (
175-
[
176-
job["jobArn"]
177-
for job in boto3.client("braket").search_jobs(filters=[])["jobs"]
178-
if job["jobName"] == job_completed_name
179-
][0]
180-
if os.getenv("JOBS_STARTED")
181-
else None
182-
)
174+
job_arn = [
175+
job["jobArn"]
176+
for job in boto3.client("braket").search_jobs(filters=[])["jobs"]
177+
if job["jobName"] == job_completed_name
178+
][0]
183179

184-
return AwsQuantumJob(arn=job_arn) if os.getenv("JOBS_STARTED") else None
180+
return AwsQuantumJob(arn=job_arn)
185181

186182

187183
@pytest.fixture(scope="session", autouse=True)
188184
def failed_quantum_job(job_failed_name):
189-
job_arn = (
190-
[
191-
job["jobArn"]
192-
for job in boto3.client("braket").search_jobs(filters=[])["jobs"]
193-
if job["jobName"] == job_failed_name
194-
][0]
195-
if os.getenv("JOBS_STARTED")
196-
else None
197-
)
185+
job_arn = [
186+
job["jobArn"]
187+
for job in boto3.client("braket").search_jobs(filters=[])["jobs"]
188+
if job["jobName"] == job_failed_name
189+
][0]
198190

199-
return AwsQuantumJob(arn=job_arn) if os.getenv("JOBS_STARTED") else None
191+
return AwsQuantumJob(arn=job_arn)

0 commit comments

Comments
 (0)