Skip to content

Remove pytest fixture and fix test_tag/s method #2109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions tests/integ/sagemaker/lineage/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@
association,
artifact,
)
from sagemaker.session import Session

from smexperiments import trial_component, trial, experiment

from tests.integ.sagemaker.lineage.helpers import name, names

SLEEP_TIME_SECONDS = 1


@pytest.fixture()
def sagemaker_session(boto_session):
return Session(boto_session=boto_session)


@pytest.fixture
def action_obj(sagemaker_session):
obj = action.Action.create(
Expand Down
10 changes: 7 additions & 3 deletions tests/integ/sagemaker/lineage/test_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def test_tag(action_obj, sagemaker_session):
)["Tags"]
if actual_tags:
break
assert len(actual_tags) == 1
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
# length of actual tags will be 2
assert len(actual_tags) > 0
assert actual_tags[0] == tag


Expand All @@ -104,5 +106,7 @@ def test_tags(action_obj, sagemaker_session):
)["Tags"]
if actual_tags:
break
assert len(actual_tags) == 1
assert actual_tags == tags
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
# length of actual tags will be 2
assert len(actual_tags) > 0
assert [actual_tags[-1]] == tags
10 changes: 7 additions & 3 deletions tests/integ/sagemaker/lineage/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def test_tag(artifact_obj, sagemaker_session):
)["Tags"]
if actual_tags:
break
assert len(actual_tags) == 1
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
# length of actual tags will be 2
assert len(actual_tags) > 0
assert actual_tags[0] == tag


Expand All @@ -113,5 +115,7 @@ def test_tags(artifact_obj, sagemaker_session):
)["Tags"]
if actual_tags:
break
assert len(actual_tags) == 1
assert actual_tags == tags
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
# length of actual tags will be 2
assert len(actual_tags) > 0
assert [actual_tags[-1]] == tags
10 changes: 7 additions & 3 deletions tests/integ/sagemaker/lineage/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def test_tag(context_obj, sagemaker_session):
)["Tags"]
if actual_tags:
break
assert len(actual_tags) == 1
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
# length of actual tags will be 2
assert len(actual_tags) > 0
assert actual_tags[0] == tag


Expand All @@ -102,5 +104,7 @@ def test_tags(context_obj, sagemaker_session):
)["Tags"]
if actual_tags:
break
assert len(actual_tags) == 1
assert actual_tags == tags
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
# length of actual tags will be 2
assert len(actual_tags) > 0
assert [actual_tags[-1]] == tags