Issue #21099: Switch applicable importlib tests to use PEP 451 API.

This commit is contained in:
Eric Snow 2016-05-10 16:21:03 -06:00
parent 3fa86a0612
commit 228ab1ff6b
8 changed files with 108 additions and 38 deletions

View file

@ -16,9 +16,18 @@ def path_hook(self):
def test_success(self):
with util.create_modules('dummy') as mapping:
self.assertTrue(hasattr(self.path_hook()(mapping['.root']),
'find_module'))
'find_spec'))
def test_success_legacy(self):
with util.create_modules('dummy') as mapping:
self.assertTrue(hasattr(self.path_hook()(mapping['.root']),
'find_module'))
def test_empty_string(self):
# The empty string represents the cwd.
self.assertTrue(hasattr(self.path_hook()(''), 'find_spec'))
def test_empty_string_legacy(self):
# The empty string represents the cwd.
self.assertTrue(hasattr(self.path_hook()(''), 'find_module'))