diff options
author | Brett Cannon <brett@python.org> | 2016-07-16 17:45:16 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-07-16 17:45:16 (GMT) |
commit | 4106f61c4c60a0d981b16aca08daa89cdd07a29b (patch) | |
tree | fd542246d2e8c18e58f552792df7e36a1ef6a7ae /Lib/test/test_importlib/source | |
parent | d2fe862baba9e98ec19d00184c1405ddc978f924 (diff) | |
parent | 7ca63cb7cc0ea962f40559ba57f767e38d7f1af7 (diff) | |
download | cpython-4106f61c4c60a0d981b16aca08daa89cdd07a29b.zip cpython-4106f61c4c60a0d981b16aca08daa89cdd07a29b.tar.gz cpython-4106f61c4c60a0d981b16aca08daa89cdd07a29b.tar.bz2 |
Merge for #27083
Diffstat (limited to 'Lib/test/test_importlib/source')
-rw-r--r-- | Lib/test/test_importlib/source/test_case_sensitivity.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Lib/test/test_importlib/source/test_case_sensitivity.py b/Lib/test/test_importlib/source/test_case_sensitivity.py index aac820b..12ce0cb 100644 --- a/Lib/test/test_importlib/source/test_case_sensitivity.py +++ b/Lib/test/test_importlib/source/test_case_sensitivity.py @@ -10,7 +10,7 @@ import unittest @util.case_insensitive_tests -class CaseSensitivityTest: +class CaseSensitivityTest(util.CASEOKTestBase): """PEP 235 dictates that on case-preserving, case-insensitive file systems that imports are case-sensitive unless the PYTHONCASEOK environment @@ -38,17 +38,10 @@ class CaseSensitivityTest: insensitive_finder = self.finder(insensitive_path) return self.find(sensitive_finder), self.find(insensitive_finder) - def env_changed(self, *, should_exist): - possibilities = b'PYTHONCASEOK', 'PYTHONCASEOK' - if any(x in self.importlib._bootstrap_external._os.environ - for x in possibilities) == should_exist: - self.skipTest('os.environ changes not reflected in ' - '_os.environ') - def test_sensitive(self): with test_support.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') - self.env_changed(should_exist=False) + self.caseok_env_changed(should_exist=False) sensitive, insensitive = self.sensitivity_test() self.assertIsNotNone(sensitive) self.assertIn(self.name, sensitive.get_filename(self.name)) @@ -57,7 +50,7 @@ class CaseSensitivityTest: def test_insensitive(self): with test_support.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') - self.env_changed(should_exist=True) + self.caseok_env_changed(should_exist=True) sensitive, insensitive = self.sensitivity_test() self.assertIsNotNone(sensitive) self.assertIn(self.name, sensitive.get_filename(self.name)) |