Skip to content

Commit 6c67bea

Browse files
stisacajaykarpuricywang86ruiahsan-z-khan
authored
Remove pytest fixture and fix test_tag/s method (#2109)
* Remove pytest fixture and fix test_tag/s method * Remove pytest fixture and fix test_tag/s method * Remove pytest fixture and fix test_tag/s method Co-authored-by: Ajay Karpur <[email protected]> Co-authored-by: icywang86rui <[email protected]> Co-authored-by: Ahsan Khan <[email protected]>
1 parent 54fd5f1 commit 6c67bea

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

tests/integ/sagemaker/lineage/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,14 @@
2525
association,
2626
artifact,
2727
)
28-
from sagemaker.session import Session
28+
2929
from smexperiments import trial_component, trial, experiment
3030

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

3333
SLEEP_TIME_SECONDS = 1
3434

3535

36-
@pytest.fixture()
37-
def sagemaker_session(boto_session):
38-
return Session(boto_session=boto_session)
39-
40-
4136
@pytest.fixture
4237
def action_obj(sagemaker_session):
4338
obj = action.Action.create(

tests/integ/sagemaker/lineage/test_action.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def test_tag(action_obj, sagemaker_session):
9090
)["Tags"]
9191
if actual_tags:
9292
break
93-
assert len(actual_tags) == 1
93+
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
94+
# length of actual tags will be 2
95+
assert len(actual_tags) > 0
9496
assert actual_tags[0] == tag
9597

9698

@@ -104,5 +106,7 @@ def test_tags(action_obj, sagemaker_session):
104106
)["Tags"]
105107
if actual_tags:
106108
break
107-
assert len(actual_tags) == 1
108-
assert actual_tags == tags
109+
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
110+
# length of actual tags will be 2
111+
assert len(actual_tags) > 0
112+
assert [actual_tags[-1]] == tags

tests/integ/sagemaker/lineage/test_artifact.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ def test_tag(artifact_obj, sagemaker_session):
9999
)["Tags"]
100100
if actual_tags:
101101
break
102-
assert len(actual_tags) == 1
102+
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
103+
# length of actual tags will be 2
104+
assert len(actual_tags) > 0
103105
assert actual_tags[0] == tag
104106

105107

@@ -113,5 +115,7 @@ def test_tags(artifact_obj, sagemaker_session):
113115
)["Tags"]
114116
if actual_tags:
115117
break
116-
assert len(actual_tags) == 1
117-
assert actual_tags == tags
118+
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
119+
# length of actual tags will be 2
120+
assert len(actual_tags) > 0
121+
assert [actual_tags[-1]] == tags

tests/integ/sagemaker/lineage/test_context.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def test_tag(context_obj, sagemaker_session):
8888
)["Tags"]
8989
if actual_tags:
9090
break
91-
assert len(actual_tags) == 1
91+
# When sagemaker-client-config endpoint-url is passed as argument to hit beta,
92+
# length of actual tags will be 2
93+
assert len(actual_tags) > 0
9294
assert actual_tags[0] == tag
9395

9496

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

0 commit comments

Comments
 (0)