Skip to content

Commit

Permalink
Mcknight/fix test store test (#832) (#919)
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)

Co-authored-by: Matthew McKnight <[email protected]>
  • Loading branch information
github-actions[bot] and McKnight-42 authored Oct 24, 2023
1 parent 7abad07 commit 838cedc
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit 838cedc

Please sign in to comment.