From df0c3776c29d6cc6effd9bcec68fd06d7abde4b7 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sun, 29 Oct 2017 17:01:42 +0100 Subject: testutil: Simplify tests to use shutil.rmtree() for tempdir --- tests/testutil.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tests/testutil.py') 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() -- cgit v1.2.3