bpo-40275: Fix failed test cases by using test helpers by shihai1991 · Pull Request #21811 · python/cpython

Expand Up @@ -7,7 +7,7 @@ machinery = util.import_importlib('importlib.machinery')
import os from test import support as test_support from test.support import os_helper import unittest

Expand Down Expand Up @@ -42,7 +42,7 @@ def sensitivity_test(self):
@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() Expand All @@ -52,7 +52,7 @@ def test_sensitive(self):
@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() Expand Down