From d132928def976304034b6a5a2dfe32fa591f809f Mon Sep 17 00:00:00 2001 From: Matthew McKnight Date: Tue, 11 Jul 2023 16:33:40 -0500 Subject: [PATCH 1/3] add teardown_method for store_test_fail test --- .../test_store_test_failures.py | 11 +++++++++++ 1 file changed, 11 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..a5342f215 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) From c6afbd59476b7a2d344ae8e3e43f20f586085e28 Mon Sep 17 00:00:00 2001 From: Matthew McKnight Date: Wed, 12 Jul 2023 14:15:58 -0500 Subject: [PATCH 2/3] create pr From 40a4e66a215babea9d497d1246d6993c56a097a6 Mon Sep 17 00:00:00 2001 From: Matthew McKnight Date: Mon, 16 Oct 2023 16:23:04 -0500 Subject: [PATCH 3/3] add teardown to delta test class as it also builds tests on alt schema --- tests/functional/adapter/test_store_test_failures.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/functional/adapter/test_store_test_failures.py b/tests/functional/adapter/test_store_test_failures.py index 822cb57a2..e78bd4f71 100644 --- a/tests/functional/adapter/test_store_test_failures.py +++ b/tests/functional/adapter/test_store_test_failures.py @@ -51,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)