diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-29 17:01:42 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-29 17:01:42 +0100 |
commit | df0c3776c29d6cc6effd9bcec68fd06d7abde4b7 (patch) | |
tree | df0126f3bf6482c505a8fb9defd374ba89d5bc31 /tests/testutil.py | |
parent | 25bb1604ed7c81e3192cd7c4616ffdceabd64ad4 (diff) | |
download | gemato-df0c3776c29d6cc6effd9bcec68fd06d7abde4b7.tar.gz |
testutil: Simplify tests to use shutil.rmtree() for tempdir
Diffstat (limited to 'tests/testutil.py')
-rw-r--r-- | tests/testutil.py | 7 |
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() |