summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_dir_util.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-02-14 14:35:51 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-02-14 14:35:51 (GMT)
commitc1375d5e0168450b7411227ad3b95286aa1d70b4 (patch)
treedc4ab4ce5a44dfe26d8d930aee2418b002d52863 /Lib/distutils/tests/test_dir_util.py
parent9e8dbbcdcd462efc8f50008c7182dd399de89097 (diff)
downloadcpython-c1375d5e0168450b7411227ad3b95286aa1d70b4.zip
cpython-c1375d5e0168450b7411227ad3b95286aa1d70b4.tar.gz
cpython-c1375d5e0168450b7411227ad3b95286aa1d70b4.tar.bz2
Merged revisions 69609 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69609 | tarek.ziade | 2009-02-14 15:10:23 +0100 (Sat, 14 Feb 2009) | 1 line Fix for #5257: refactored all tests in distutils, so they use a temporary directory. ........
Diffstat (limited to 'Lib/distutils/tests/test_dir_util.py')
-rw-r--r--Lib/distutils/tests/test_dir_util.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
index edf93c4..bf416b6 100644
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -9,8 +9,9 @@ from distutils.dir_util import create_tree
from distutils.dir_util import copy_tree
from distutils import log
+from distutils.tests import support
-class DirUtilTestCase(unittest.TestCase):
+class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
def _log(self, msg, *args):
if len(args) > 0:
@@ -19,18 +20,18 @@ class DirUtilTestCase(unittest.TestCase):
self._logs.append(msg)
def setUp(self):
+ support.TempdirManager.setUp(self)
self._logs = []
- self.root_target = os.path.join(os.path.dirname(__file__), 'deep')
+ tmp_dir = self.mkdtemp()
+ self.root_target = os.path.join(tmp_dir, 'deep')
self.target = os.path.join(self.root_target, 'here')
- self.target2 = os.path.join(os.path.dirname(__file__), 'deep2')
+ self.target2 = os.path.join(tmp_dir, 'deep2')
self.old_log = log.info
log.info = self._log
def tearDown(self):
- for target in (self.target, self.target2):
- if os.path.exists(target):
- shutil.rmtree(target)
log.info = self.old_log
+ support.TempdirManager.tearDown(self)
def test_mkpath_remove_tree_verbosity(self):