Skip to content

Commit

Permalink
Merge pull request #422 from atlanhq/FT-782
Browse files Browse the repository at this point in the history
FT-782 Correct issue deleting created tags at end of tests
  • Loading branch information
ErnestoLoma authored Nov 20, 2024
2 parents a73014c + 1d3fed9 commit 48322a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions tests/integration/purpose_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def test_find_purpose_by_name(
client: AtlanClient,
purpose: Purpose,
):
result = None
with contextlib.suppress(NotFoundError):
result = client.asset.find_purposes_by_name(
MODULE_NAME, attributes=["purposeClassifications"]
Expand Down
14 changes: 4 additions & 10 deletions tests/integration/suggestions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def v2c1(

@pytest.fixture(scope="module")
def create_atlan_tag1(
make_atlan_tag,
client: AtlanClient,
table1: Table,
table3: Table,
Expand All @@ -285,10 +286,7 @@ def create_atlan_tag1(
) -> Generator[AtlanTagDef, None, None]:
assert table1.qualified_name and table3.qualified_name
assert t1c1.qualified_name and v2c1.qualified_name
cls = AtlanTagDef.create(
name=ATLAN_TAG_NAME1,
)
yield client.typedef.create(cls).atlan_tag_defs[0]
yield make_atlan_tag(ATLAN_TAG_NAME1)
client.asset.remove_atlan_tag(
asset_type=Table,
qualified_name=table1.qualified_name,
Expand All @@ -309,11 +307,11 @@ def create_atlan_tag1(
qualified_name=v2c1.qualified_name,
atlan_tag_name=ATLAN_TAG_NAME1,
)
client.typedef.purge(ATLAN_TAG_NAME1, typedef_type=AtlanTagDef)


@pytest.fixture(scope="module")
def create_atlan_tag2(
make_atlan_tag,
client: AtlanClient,
table1: Table,
table3: Table,
Expand All @@ -325,10 +323,7 @@ def create_atlan_tag2(
assert table1.qualified_name and table3.qualified_name
assert t1c1.qualified_name and t2c1.qualified_name
assert v1c1.qualified_name and v2c1.qualified_name
cls = AtlanTagDef.create(
name=ATLAN_TAG_NAME2,
)
yield client.typedef.create(cls).atlan_tag_defs[0]
yield make_atlan_tag(ATLAN_TAG_NAME2)
client.asset.remove_atlan_tag(
asset_type=Table,
qualified_name=table1.qualified_name,
Expand Down Expand Up @@ -359,7 +354,6 @@ def create_atlan_tag2(
qualified_name=v2c1.qualified_name,
atlan_tag_name=ATLAN_TAG_NAME2,
)
client.typedef.purge(ATLAN_TAG_NAME2, typedef_type=AtlanTagDef)


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 48322a9

Please sign in to comment.