Skip to content

Commit

Permalink
Mcknight/fix test store test (#832)
Browse files Browse the repository at this point in the history
* add teardown_method for store_test_fail test

* create pr

* add teardown to delta test class as it also builds tests on alt schema

(cherry picked from commit 99c5c5a)
  • Loading branch information
McKnight-42 authored and github-actions[bot] committed Oct 17, 2023
1 parent db0156e commit f62d8a8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/functional/adapter/test_store_test_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ def project_config_update(self):
"tests": {"+schema": TEST_AUDIT_SCHEMA_SUFFIX, "+store_failures": True},
}

@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}_{TEST_AUDIT_SCHEMA_SUFFIX}",
)

project.adapter.drop_schema(relation)

def test_store_and_assert(self, project):
self.run_tests_store_one_failure(project)
self.run_tests_store_failures_and_assert(project)
Expand All @@ -40,6 +51,17 @@ def project_config_update(self):
},
}

@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}_{TEST_AUDIT_SCHEMA_SUFFIX}",
)

project.adapter.drop_schema(relation)

def test_store_and_assert_failure_with_delta(self, project):
self.run_tests_store_one_failure(project)
self.run_tests_store_failures_and_assert(project)
Expand Down

0 comments on commit f62d8a8

Please sign in to comment.