summaryrefslogtreecommitdiff
path: root/tests/testutil.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-29 17:01:42 +0100
committerMichał Górny <mgorny@gentoo.org>2017-10-29 17:01:42 +0100
commitdf0c3776c29d6cc6effd9bcec68fd06d7abde4b7 (patch)
treedf0126f3bf6482c505a8fb9defd374ba89d5bc31 /tests/testutil.py
parent25bb1604ed7c81e3192cd7c4616ffdceabd64ad4 (diff)
downloadgemato-df0c3776c29d6cc6effd9bcec68fd06d7abde4b7.tar.gz
testutil: Simplify tests to use shutil.rmtree() for tempdir
Diffstat (limited to 'tests/testutil.py')
-rw-r--r--tests/testutil.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/testutil.py b/tests/testutil.py
index 2a002c1..9e294a5 100644
--- a/tests/testutil.py
+++ b/tests/testutil.py
@@ -7,6 +7,7 @@ import io
import logging
import os
import os.path
+import shutil
import sys
import tempfile
import unittest
@@ -40,9 +41,5 @@ class TempDirTestCase(LoggingTestCase):
f.write(v)
def tearDown(self):
- for k in self.FILES:
- os.unlink(os.path.join(self.dir, k))
- for k in reversed(self.DIRS):
- os.rmdir(os.path.join(self.dir, k))
- os.rmdir(self.dir)
+ shutil.rmtree(self.dir)
super(TempDirTestCase, self).tearDown()