Skip to content

Commit

Permalink
fix: set python container version explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
ajberdy committed Nov 1, 2023
1 parent 14a85a7 commit 9e801b8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/integ_tests/test_create_quantum_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
from braket.jobs import Framework, get_input_data_dir, hybrid_job, retrieve_image, save_job_result


@pytest.fixture
def decorator_python_version(aws_session):
image_uri = retrieve_image(Framework.BASE, aws_session.region)
tag = aws_session.get_full_image_tag(image_uri)
major_version, minor_version = re.search(r"-py(\d)(\d+)-", tag).groups()
return major_version, minor_version
# todo: capture python version from container
# @pytest.fixture
# def decorator_python_version(aws_session):
# image_uri = retrieve_image(Framework.BASE, aws_session.region)
# tag = aws_session.get_full_image_tag(image_uri)
# major_version, minor_version = re.search(r"-py(\d)(\d+)-", tag).groups()
# return major_version, minor_version


def test_failed_quantum_job(aws_session, capsys):
Expand Down Expand Up @@ -200,7 +201,7 @@ def test_completed_quantum_job(aws_session, capsys):


@pytest.mark.xfail(
(sys.version_info.major, sys.version_info.minor) != decorator_python_version,
(sys.version_info.major, sys.version_info.minor) != (3, 10),
raises=RuntimeError,
reason="Python version mismatch",
)
Expand Down Expand Up @@ -264,7 +265,7 @@ def decorator_job(a, b: int, c=0, d: float = 1.0, **extras):


@pytest.mark.xfail(
(sys.version_info.major, sys.version_info.minor) != decorator_python_version,
(sys.version_info.major, sys.version_info.minor) != (3, 10),
raises=RuntimeError,
reason="Python version mismatch",
)
Expand Down

0 comments on commit 9e801b8

Please sign in to comment.