mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40275: Fix failed test cases by using test helpers (GH-21811)
This commit is contained in:
parent
a02efe4d27
commit
490c5426b1
4 changed files with 9 additions and 9 deletions
|
@ -7,7 +7,7 @@ importlib = util.import_importlib('importlib')
|
|||
machinery = util.import_importlib('importlib.machinery')
|
||||
|
||||
import os
|
||||
from test import support as test_support
|
||||
from test.support import os_helper
|
||||
import unittest
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@ class CaseSensitivityTest(util.CASEOKTestBase):
|
|||
|
||||
@unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set')
|
||||
def test_sensitive(self):
|
||||
with test_support.EnvironmentVarGuard() as env:
|
||||
with os_helper.EnvironmentVarGuard() as env:
|
||||
env.unset('PYTHONCASEOK')
|
||||
self.caseok_env_changed(should_exist=False)
|
||||
sensitive, insensitive = self.sensitivity_test()
|
||||
|
@ -52,7 +52,7 @@ class CaseSensitivityTest(util.CASEOKTestBase):
|
|||
|
||||
@unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set')
|
||||
def test_insensitive(self):
|
||||
with test_support.EnvironmentVarGuard() as env:
|
||||
with os_helper.EnvironmentVarGuard() as env:
|
||||
env.set('PYTHONCASEOK', '1')
|
||||
self.caseok_env_changed(should_exist=True)
|
||||
sensitive, insensitive = self.sensitivity_test()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue