From f62d8a835ed62b088e0c5701aa6ca27a0321be50 Mon Sep 17 00:00:00 2001 From: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:35:01 -0500 Subject: [PATCH] Mcknight/fix test store test (#832) * 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 99c5c5ad4cad053e556af50afb77603c821ce538) --- .../adapter/test_store_test_failures.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/functional/adapter/test_store_test_failures.py b/tests/functional/adapter/test_store_test_failures.py index e27cb9b95..e78bd4f71 100644 --- a/tests/functional/adapter/test_store_test_failures.py +++ b/tests/functional/adapter/test_store_test_failures.py @@ -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) @@ -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)