Skip to content

Commit 689d0b8

Browse files
committed
fix schema drop
1 parent 489154e commit 689d0b8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/functional/adapter/test_seed.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
seeds__disabled_in_config_csv,
1818
seeds__enabled_in_config_csv,
1919
)
20-
from dbt.tests.util import copy_file
20+
from dbt.tests.util import copy_file, get_connection
21+
22+
from dbt.adapters.sqlserver import SQLServerAdapter
2123

2224
fixed_setup_sql = seeds__expected_sql.replace("TIMESTAMP WITHOUT TIME ZONE", "DATETIME").replace(
2325
"TEXT", "VARCHAR(255)"
@@ -157,7 +159,14 @@ def setUp(self, project):
157159

158160

159161
class TestSimpleSeedEnabledViaConfigSQLServer(TestSimpleSeedEnabledViaConfig):
160-
pass
162+
@pytest.fixture(scope="function")
163+
def clear_test_schema(self, project):
164+
yield
165+
adapter = project.adapter
166+
assert isinstance(project.adapter, SQLServerAdapter)
167+
with get_connection(project.adapter):
168+
rel = adapter.Relation.create(database=project.database, schema=project.test_schema)
169+
adapter.drop_schema(rel)
161170

162171

163172
class TestSeedParsingSQLServer(TestSeedParsing):

0 commit comments

Comments
 (0)