Skip to content

Commit

Permalink
add clean_up method for store_test_failures tests to stop hanging art… (
Browse files Browse the repository at this point in the history
#803)

* add clean_up method for store_test_failures tests to stop hanging artifacts in bigquery

* rename clean_up to teardown and change scope

* re-add function scope
  • Loading branch information
McKnight-42 authored Jul 7, 2023
1 parent 2182d3d commit 2fb5681
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import pytest
from dbt.tests.adapter.store_test_failures_tests.test_store_test_failures import (
StoreTestFailuresBase,
)


TEST_AUDIT_SCHEMA_SUFFIX = "dbt_test__aud"


class TestBigQueryStoreTestFailures(StoreTestFailuresBase):
@pytest.fixture(scope="function", autouse=True)
def teardown_method(self, project):
yield
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)

0 comments on commit 2fb5681

Please sign in to comment.