Skip to content

Commit 67a8163

Browse files
committed
add test tear down: rm *.db files so the next test doesn't pick them up
1 parent 3499734 commit 67a8163

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed
Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
import glob
3+
import os
4+
15
import pytest
26

37
from dbt.tests.adapter.basic.test_base import BaseSimpleMaterializations
@@ -11,41 +15,50 @@
1115
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp
1216
from dbt.tests.adapter.basic.test_adapter_methods import BaseAdapterMethod
1317

14-
class TestSimpleMaterializationsSqlite(BaseSimpleMaterializations):
18+
19+
class TearDownMixin():
20+
@classmethod
21+
def teardown_class(module):
22+
for path in glob.glob('/tmp/dbt-sqlite-tests/*.db'):
23+
print("DELETING")
24+
os.remove(path)
25+
26+
27+
class TestSimpleMaterializationsSqlite(BaseSimpleMaterializations, TearDownMixin):
1528
pass
1629

1730

18-
class TestSingularTestsSqlite(BaseSingularTests):
31+
class TestSingularTestsSqlite(BaseSingularTests, TearDownMixin):
1932
pass
2033

2134

22-
class TestSingularTestsEphemeralSqlite(BaseSingularTestsEphemeral):
35+
class TestSingularTestsEphemeralSqlite(BaseSingularTestsEphemeral, TearDownMixin):
2336
pass
2437

2538

26-
class TestEmptySqlite(BaseEmpty):
39+
class TestEmptySqlite(BaseEmpty, TearDownMixin):
2740
pass
2841

2942

30-
class TestEphemeralSqlite(BaseEphemeral):
43+
class TestEphemeralSqlite(BaseEphemeral, TearDownMixin):
3144
pass
3245

3346

34-
class TestIncrementalSqlite(BaseIncremental):
47+
class TestIncrementalSqlite(BaseIncremental, TearDownMixin):
3548
pass
3649

3750

38-
class TestGenericTestsSqlite(BaseGenericTests):
51+
class TestGenericTestsSqlite(BaseGenericTests, TearDownMixin):
3952
pass
4053

4154

42-
class TestSnapshotCheckColsSqlite(BaseSnapshotCheckCols):
55+
class TestSnapshotCheckColsSqlite(BaseSnapshotCheckCols, TearDownMixin):
4356
pass
4457

4558

46-
class TestSnapshotTimestampSqlite(BaseSnapshotTimestamp):
59+
class TestSnapshotTimestampSqlite(BaseSnapshotTimestamp, TearDownMixin):
4760
pass
4861

4962

50-
class TestBaseAdapterMethod(BaseAdapterMethod):
63+
class TestBaseAdapterMethod(BaseAdapterMethod, TearDownMixin):
5164
pass

0 commit comments

Comments
 (0)