From ab94c8977c0ac606394dedc194dfff992386e8b0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:33:38 -0700 Subject: [PATCH] Mcknight/fix test store test (#832) (#920) * 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) Co-authored-by: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> --- .../test_store_test_failures.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/functional/adapter/store_test_failures_tests/test_store_test_failures.py b/tests/functional/adapter/store_test_failures_tests/test_store_test_failures.py index c445fe671..327a9884b 100644 --- a/tests/functional/adapter/store_test_failures_tests/test_store_test_failures.py +++ b/tests/functional/adapter/store_test_failures_tests/test_store_test_failures.py @@ -17,6 +17,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) @@ -39,6 +50,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)