Skip to content

Commit c4c02de

Browse files
committed
Clean up tempdir after testing
1 parent 755c9cd commit c4c02de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/detect/platform_database.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import logging
2020
import tempfile
2121
import json
22+
import shutil
2223
from mock import patch, MagicMock, DEFAULT
2324
from io import StringIO
2425

@@ -35,14 +36,16 @@ class EmptyPlatformDatabaseTests(unittest.TestCase):
3536
"""
3637

3738
def setUp(self):
38-
self.base_db_path = os.path.join(tempfile.mkdtemp(), 'base')
39+
self.tempd_dir = tempfile.mkdtemp()
40+
self.base_db_path = os.path.join(self.tempd_dir, 'base')
3941
self.base_db = open(self.base_db_path, 'w+b')
4042
self.base_db.write(b'{}')
4143
self.base_db.seek(0)
4244
self.pdb = PlatformDatabase([self.base_db_path])
4345

4446
def tearDown(self):
4547
self.base_db.close()
48+
shutil.rmtree(self.tempd_dir)
4649

4750
def test_broken_database_io(self):
4851
"""Verify that the platform database still works without a

0 commit comments

Comments
 (0)