[Python-checkins] cpython: Clean up extra environment variable after packaging tests.

eric.araujo python-checkins at python.org
Fri Jun 10 18:35:07 CEST 2011


http://hg.python.org/cpython/rev/cb4ea696951e
changeset:   70763:cb4ea696951e
user:        Éric Araujo <merwok at netwok.org>
date:        Fri Jun 10 04:29:43 2011 +0200
summary:
  Clean up extra environment variable after packaging tests.

packaging.util.check_environ will define HOME and PLAT if they don’t exist; for
some reason, it does not define PLAT when running the tests from a checkout (so
no regrtest warning) but does when running from an installed Python.

Cleaning up the envvar in test_dist fixes the warning on my machine, but I
suspect that a test runner using a different order to run files or running them
in parallel may have PLAT defined in its environment because of another test.
Quite a lot of code ends up calling check_environ; maybe we should just clean
up PLAT in every test.  For now I’m doing this simple fix, we’ll see if we get
bug reports.

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


diff --git a/Lib/packaging/tests/test_dist.py b/Lib/packaging/tests/test_dist.py
--- a/Lib/packaging/tests/test_dist.py
+++ b/Lib/packaging/tests/test_dist.py
@@ -35,7 +35,7 @@
                            support.EnvironRestorer,
                            unittest.TestCase):
 
-    restore_environ = ['HOME']
+    restore_environ = ['HOME', 'PLAT']
 
     def setUp(self):
         super(DistributionTestCase, self).setUp()

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


More information about the Python-checkins mailing list