@@ -137,6 +137,23 @@ def setUp(self, project):
137137
138138
139139class TestSimpleSeedEnabledViaConfig__seed_with_disabled (BaseSimpleSeedEnabledViaConfig ):
140+ @pytest .fixture (scope = "function" )
141+ def clear_test_schema (self , project ):
142+ yield
143+ project .run_sql (
144+ f"drop table if exists { project .database } .{ project .test_schema } .seed_enabled"
145+ )
146+ project .run_sql (
147+ f"drop table if exists { project .database } .{ project .test_schema } .seed_disabled"
148+ )
149+ project .run_sql (
150+ f"drop table if exists { project .database } .{ project .test_schema } .seed_tricky"
151+ )
152+ project .run_sql (f"drop view if exists { project .test_schema } .seed_enabled" )
153+ project .run_sql (f"drop view if exists { project .test_schema } .seed_disabled" )
154+ project .run_sql (f"drop view if exists { project .test_schema } .seed_tricky" )
155+ project .run_sql (f"drop schema if exists { project .test_schema } " )
156+
140157 def test_simple_seed_with_disabled (self , clear_test_schema , project ):
141158 results = run_dbt (["seed" ])
142159 assert len (results ) == 2
@@ -172,6 +189,23 @@ def test_simple_seed_exclude(self, clear_test_schema, project):
172189
173190
174191class TestSimpleSeedEnabledViaConfig__seed_selection (BaseSimpleSeedEnabledViaConfig ):
192+ @pytest .fixture (scope = "function" )
193+ def clear_test_schema (self , project ):
194+ yield
195+ project .run_sql (
196+ f"drop table if exists { project .database } .{ project .test_schema } .seed_enabled"
197+ )
198+ project .run_sql (
199+ f"drop table if exists { project .database } .{ project .test_schema } .seed_disabled"
200+ )
201+ project .run_sql (
202+ f"drop table if exists { project .database } .{ project .test_schema } .seed_tricky"
203+ )
204+ project .run_sql (f"drop view if exists { project .test_schema } .seed_enabled" )
205+ project .run_sql (f"drop view if exists { project .test_schema } .seed_disabled" )
206+ project .run_sql (f"drop view if exists { project .test_schema } .seed_tricky" )
207+ project .run_sql (f"drop schema if exists { project .test_schema } " )
208+
175209 @pytest .mark .skip (
176210 reason = """
177211 Running all the tests in the same schema causes the tests to fail
@@ -207,6 +241,23 @@ def test_simple_seed_exclude(self, clear_test_schema, project):
207241
208242
209243class TestSimpleSeedEnabledViaConfig__seed_exclude (BaseSimpleSeedEnabledViaConfig ):
244+ @pytest .fixture (scope = "function" )
245+ def clear_test_schema (self , project ):
246+ yield
247+ project .run_sql (
248+ f"drop table if exists { project .database } .{ project .test_schema } .seed_enabled"
249+ )
250+ project .run_sql (
251+ f"drop table if exists { project .database } .{ project .test_schema } .seed_disabled"
252+ )
253+ project .run_sql (
254+ f"drop table if exists { project .database } .{ project .test_schema } .seed_tricky"
255+ )
256+ project .run_sql (f"drop view if exists { project .test_schema } .seed_enabled" )
257+ project .run_sql (f"drop view if exists { project .test_schema } .seed_disabled" )
258+ project .run_sql (f"drop view if exists { project .test_schema } .seed_tricky" )
259+ project .run_sql (f"drop schema if exists { project .test_schema } " )
260+
210261 @pytest .mark .skip (
211262 reason = """
212263 Running all the tests in the same schema causes the tests to fail
0 commit comments