bpo-40275: Fix failed test cases by using test helpers by shihai1991 · Pull Request #21811 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Lib/test/test__osx_support.py
6 changes: 3 additions & 3 deletions Lib/test/test_importlib/extension/test_case_sensitivity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from importlib import _bootstrap_external
from test import support
from test.support import os_helper
import unittest
import sys
from .. import util
Expand All @@ -23,15 +23,15 @@ def find_module(self):

@unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set')
def test_case_sensitive(self):
with support.EnvironmentVarGuard() as env:
with os_helper.EnvironmentVarGuard() as env:
env.unset('PYTHONCASEOK')
self.caseok_env_changed(should_exist=False)
loader = self.find_module()
self.assertIsNone(loader)

@unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set')
def test_case_insensitivity(self):
with support.EnvironmentVarGuard() as env:
with os_helper.EnvironmentVarGuard() as env:
env.set('PYTHONCASEOK', '1')
self.caseok_env_changed(should_exist=True)
loader = self.find_module()
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_importlib/source/test_case_sensitivity.py
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion Lib/test/test_selectors.py