[Python-checkins] cpython: Issue #13890: Fix importlib case-sensitivity tests to not run on Windows.

brett.cannon python-checkins at python.org
Mon Jan 30 18:49:43 CET 2012


http://hg.python.org/cpython/rev/54d7823ec488
changeset:   74687:54d7823ec488
user:        Brett Cannon <brett at python.org>
date:        Mon Jan 30 12:48:16 2012 -0500
summary:
  Issue #13890: Fix importlib case-sensitivity tests to not run on Windows.
Thanks to os.environ under Windows only updating the dict and not the
environment itself (as exposed by nt.environ), tests using
PYTHONCASEOK always fail. Now the tests are skipped when os.environ
does not do what is expected.

files:
  Lib/importlib/test/source/test_case_sensitivity.py |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Lib/importlib/test/source/test_case_sensitivity.py b/Lib/importlib/test/source/test_case_sensitivity.py
--- a/Lib/importlib/test/source/test_case_sensitivity.py
+++ b/Lib/importlib/test/source/test_case_sensitivity.py
@@ -37,6 +37,9 @@
     def test_sensitive(self):
         with test_support.EnvironmentVarGuard() as env:
             env.unset('PYTHONCASEOK')
+            if b'PYTHONCASEOK' in _bootstrap._os.environ:
+                self.skipTest('os.environ changes not reflected in '
+                              '_os.environ')
             sensitive, insensitive = self.sensitivity_test()
             self.assertTrue(hasattr(sensitive, 'load_module'))
             self.assertIn(self.name, sensitive.get_filename(self.name))
@@ -45,6 +48,9 @@
     def test_insensitive(self):
         with test_support.EnvironmentVarGuard() as env:
             env.set('PYTHONCASEOK', '1')
+            if b'PYTHONCASEOK' not in _bootstrap._os.environ:
+                self.skipTest('os.environ changes not reflected in '
+                              '_os.environ')
             sensitive, insensitive = self.sensitivity_test()
             self.assertTrue(hasattr(sensitive, 'load_module'))
             self.assertIn(self.name, sensitive.get_filename(self.name))

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


More information about the Python-checkins mailing list