[Python-checkins] cpython: Issue #12125: fixed the failures under Solaris due to improper test cleanup.

tarek.ziade python-checkins at python.org
Mon May 23 19:08:05 CEST 2011


http://hg.python.org/cpython/rev/f86fdca477e3
changeset:   70300:f86fdca477e3
user:        Tarek Ziade <tarek at ziade.org>
date:        Mon May 23 19:07:56 2011 +0200
summary:
  Issue #12125: fixed the failures under Solaris due to improper test cleanup.

files:
  Lib/packaging/tests/test_create.py    |  2 +-
  Lib/packaging/tests/test_manifest.py  |  8 ++++++++
  Lib/packaging/tests/test_uninstall.py |  5 +++++
  Misc/NEWS                             |  2 ++
  4 files changed, 16 insertions(+), 1 deletions(-)


diff --git a/Lib/packaging/tests/test_create.py b/Lib/packaging/tests/test_create.py
--- a/Lib/packaging/tests/test_create.py
+++ b/Lib/packaging/tests/test_create.py
@@ -31,11 +31,11 @@
             'doc': sys.prefix + '/share/doc/pyxfoil', }
 
     def tearDown(self):
-        super(CreateTestCase, self).tearDown()
         sys.stdin = self._stdin
         sys.stdout = self._stdout
         os.chdir(self._cwd)
         sysconfig.get_paths = self._old_get_paths
+        super(CreateTestCase, self).tearDown()
 
     def test_ask_yn(self):
         sys.stdin.write('y\n')
diff --git a/Lib/packaging/tests/test_manifest.py b/Lib/packaging/tests/test_manifest.py
--- a/Lib/packaging/tests/test_manifest.py
+++ b/Lib/packaging/tests/test_manifest.py
@@ -26,6 +26,14 @@
                        support.LoggingCatcher,
                        unittest.TestCase):
 
+    def setUp(self):
+        super(ManifestTestCase, self).setUp()
+        self.cwd = os.getcwd()
+
+    def tearDown(self):
+        os.chdir(self.cwd)
+        super(ManifestTestCase, self).tearDown()
+
     def test_manifest_reader(self):
         tmpdir = self.mkdtemp()
         MANIFEST = os.path.join(tmpdir, 'MANIFEST.in')
diff --git a/Lib/packaging/tests/test_uninstall.py b/Lib/packaging/tests/test_uninstall.py
--- a/Lib/packaging/tests/test_uninstall.py
+++ b/Lib/packaging/tests/test_uninstall.py
@@ -36,8 +36,13 @@
         self.addCleanup(os.chdir, os.getcwd())
         self.addCleanup(enable_cache)
         self.root_dir = self.mkdtemp()
+        self.cwd = os.getcwd()
         disable_cache()
 
+    def tearDown(self):
+        os.chdir(self.cwd)
+        super(UninstallTestCase, self).tearDown()
+
     def run_setup(self, *args):
         # run setup with args
         args = ['run'] + list(args)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -153,6 +153,8 @@
 Library
 -------
 
+- Issue #12125: fixed the failures under Solaris due to improper test cleanup.
+
 - Issue #6501: os.device_encoding() returns None on Windows if the application
   has no console.
 

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


More information about the Python-checkins mailing list