[Python-checkins] cpython: Squash last tempdir leak in packaging tests.

eric.araujo python-checkins at python.org
Wed Sep 21 16:36:42 CEST 2011


http://hg.python.org/cpython/rev/69915be386b2
changeset:   72438:69915be386b2
parent:      72415:b194af345cb5
user:        Éric Araujo <merwok at netwok.org>
date:        Mon Sep 19 20:57:52 2011 +0200
summary:
  Squash last tempdir leak in packaging tests.

Sweet taste of victory!  Alexis, you can fix the threads leaks :)

files:
  Lib/packaging/tests/test_pypi_dist.py |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Lib/packaging/tests/test_pypi_dist.py b/Lib/packaging/tests/test_pypi_dist.py
--- a/Lib/packaging/tests/test_pypi_dist.py
+++ b/Lib/packaging/tests/test_pypi_dist.py
@@ -1,6 +1,7 @@
 """Tests for the packaging.pypi.dist module."""
 
 import os
+import shutil
 from packaging.version import VersionPredicate
 from packaging.pypi.dist import (ReleaseInfo, ReleasesList, DistInfo,
                                  split_archive_name, get_infos_from_url)
@@ -185,6 +186,7 @@
         dist2 = Dist(url=url)
         # doing an unpack
         dist2_there = dist2.unpack()
+        self.addCleanup(shutil.rmtree, dist2_there)
         dist2_result = os.listdir(dist2_there)
         self.assertIn('paf', dist2_result)
         os.remove(os.path.join(dist2_there, 'paf'))

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list