summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2012-06-26 06:50:01 (GMT)
committerLarry Hastings <larry@hastings.org>2012-06-26 06:50:01 (GMT)
commit5b2f9c0aff4d1f17ba23fa125926279fdb5cbb15 (patch)
treeced1ffb8bd3960d66e0c29dc8ff9c24d5df31a1e
parent93e3d3ac094f788260bd61b74a0a99847466dd0e (diff)
downloadcpython-5b2f9c0aff4d1f17ba23fa125926279fdb5cbb15.zip
cpython-5b2f9c0aff4d1f17ba23fa125926279fdb5cbb15.tar.gz
cpython-5b2f9c0aff4d1f17ba23fa125926279fdb5cbb15.tar.bz2
Issue #15817: Bugfix: remove temporary directories test_shutil was leaving
behind.
-rw-r--r--Lib/test/test_shutil.py3
-rw-r--r--Misc/NEWS3
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index d23deee..49be391 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -1174,6 +1174,7 @@ class TestShutil(unittest.TestCase):
# copytree returns its destination path.
src_dir = self.mkdtemp()
dst_dir = src_dir + "dest"
+ self.addCleanup(shutil.rmtree, dst_dir, True)
src = os.path.join(src_dir, 'foo')
write_file(src, 'foo')
rv = shutil.copytree(src_dir, dst_dir)
@@ -1184,6 +1185,7 @@ class TestWhich(unittest.TestCase):
def setUp(self):
self.temp_dir = tempfile.mkdtemp()
+ self.addCleanup(shutil.rmtree, self.temp_dir, True)
# Give the temp_file an ".exe" suffix for all.
# It's needed on Windows and not harmful on other platforms.
self.temp_file = tempfile.NamedTemporaryFile(dir=self.temp_dir,
@@ -1506,6 +1508,7 @@ class TestCopyFile(unittest.TestCase):
# but a different case.
self.src_dir = tempfile.mkdtemp()
+ self.addCleanup(shutil.rmtree, self.src_dir, True)
dst_dir = os.path.join(
os.path.dirname(self.src_dir),
os.path.basename(self.src_dir).upper())
diff --git a/Misc/NEWS b/Misc/NEWS
index 724540b..82b3b72 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -58,6 +58,9 @@ Core and Builtins
Library
-------
+- Issue #15817: Bugfix: remove temporary directories test_shutil was leaving
+ behind.
+
- Issue #15177: Added dir_fd parameter to os.fwalk().
- Issue #15176: Clarified behavior, documentation, and implementation