@@ -137,6 +137,23 @@ def setUp(self, project):
137
137
138
138
139
139
class 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
+
140
157
def test_simple_seed_with_disabled (self , clear_test_schema , project ):
141
158
results = run_dbt (["seed" ])
142
159
assert len (results ) == 2
@@ -172,6 +189,23 @@ def test_simple_seed_exclude(self, clear_test_schema, project):
172
189
173
190
174
191
class 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
+
175
209
@pytest .mark .skip (
176
210
reason = """
177
211
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):
207
241
208
242
209
243
class 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
+
210
261
@pytest .mark .skip (
211
262
reason = """
212
263
Running all the tests in the same schema causes the tests to fail
0 commit comments