Add mktmpdir method to PicardTestCase, and use it more widely

This commit is contained in:
Laurent Monin
2020-02-08 17:30:51 +01:00
parent b7389a6445
commit 498c8eab1b
10 changed files with 23 additions and 41 deletions

View File

@@ -1,6 +1,4 @@
import os.path
import shutil
import tempfile
from test.picardtestcase import PicardTestCase
@@ -12,8 +10,7 @@ class Testbytes2human(PicardTestCase):
def setUp(self):
super().setUp()
# we are using temporary locales for tests
self.tmp_path = tempfile.mkdtemp(suffix=self.__class__.__name__)
self.addCleanup(shutil.rmtree, self.tmp_path)
self.tmp_path = self.mktmpdir()
self.localedir = os.path.join(self.tmp_path, 'locale')
def test_00(self):