Skip to content

Commit

Permalink
Mcknight/fix python model test (#717)
Browse files Browse the repository at this point in the history
* update RELEASE_BRANCH env

* add teardown_method to clean up hanging artfiact after test runs

(cherry picked from commit c58c54d)
  • Loading branch information
McKnight-42 authored and github-actions[bot] committed Aug 1, 2023
1 parent ab3e024 commit 886473d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/functional/adapter/test_python_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ class TestCustomSchemaWorks:
def models(self):
return {"custom_target_model.py": models__custom_target_model}

@pytest.fixture(scope="function", autouse=True)
def teardown_method(self, project):
yield
with project.adapter.connection_named("__test"):
relation = project.adapter.Relation.create(
database=project.database, schema=f"{project.test_schema}_MY_CUSTOM_SCHEMA"
)
project.adapter.drop_schema(relation)

def test_custom_target(self, project):
results = run_dbt()
assert results[0].node.schema == f"{project.test_schema}_MY_CUSTOM_SCHEMA"

0 comments on commit 886473d

Please sign in to comment.