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
import shutil
from tempfile import mkdtemp
import unittest
from test.picardtestcase import PicardTestCase
@@ -43,8 +41,7 @@ class TestPreserveTimes(PicardTestCase):
def setUp(self):
super().setUp()
self.tmp_directory = mkdtemp(suffix=self.__class__.__name__)
self.addCleanup(shutil.rmtree, self.tmp_directory)
self.tmp_directory = self.mktmpdir()
filepath = os.path.join(self.tmp_directory, 'a.mp3')
self.file = File(filepath)