summaryrefslogtreecommitdiff
path: root/tests/test_derivatives.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_derivatives.py')
-rw-r--r--tests/test_derivatives.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_derivatives.py b/tests/test_derivatives.py
index ec3ae65..ba9d79c 100644
--- a/tests/test_derivatives.py
+++ b/tests/test_derivatives.py
@@ -1,4 +1,3 @@
-import shutil
import tempfile
import unittest
@@ -23,16 +22,16 @@ class Derivative(lesana.Collection):
class testDerivatives(unittest.TestCase):
def setUp(self):
- self.tmpdir = tempfile.mkdtemp()
+ self.tmpdir = tempfile.TemporaryDirectory()
utils.copytree(
'tests/data/derivative',
- self.tmpdir,
+ self.tmpdir.name,
dirs_exist_ok=True
)
- self.collection = Derivative(self.tmpdir)
+ self.collection = Derivative(self.tmpdir.name)
def tearDown(self):
- shutil.rmtree(self.tmpdir)
+ self.tmpdir.cleanup()
def test_load_subclasses(self):
self.assertIsInstance(self.collection.fields['unknown'], DerivedType)