mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #21503: Use test_both() consistently in test_importlib.
This commit is contained in:
parent
d50cee2045
commit
3497c0bf95
30 changed files with 526 additions and 428 deletions
|
@ -5,7 +5,7 @@ import unittest
|
|||
|
||||
from .. import util
|
||||
|
||||
frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
|
||||
machinery = util.import_importlib('importlib.machinery')
|
||||
|
||||
|
||||
# XXX find_spec tests
|
||||
|
@ -41,9 +41,10 @@ class ExtensionModuleCaseSensitivityTest:
|
|||
loader = self.find_module()
|
||||
self.assertTrue(hasattr(loader, 'load_module'))
|
||||
|
||||
Frozen_ExtensionCaseSensitivity, Source_ExtensionCaseSensitivity = util.test_both(
|
||||
ExtensionModuleCaseSensitivityTest,
|
||||
machinery=[frozen_machinery, source_machinery])
|
||||
|
||||
(Frozen_ExtensionCaseSensitivity,
|
||||
Source_ExtensionCaseSensitivity
|
||||
) = util.test_both(ExtensionModuleCaseSensitivityTest, machinery=machinery)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -35,8 +35,10 @@ class FinderTests(abc.FinderTests):
|
|||
def test_failure(self):
|
||||
self.assertIsNone(self.find_module('asdfjkl;'))
|
||||
|
||||
Frozen_FinderTests, Source_FinderTests = util.test_both(
|
||||
FinderTests, machinery=machinery)
|
||||
|
||||
(Frozen_FinderTests,
|
||||
Source_FinderTests
|
||||
) = util.test_both(FinderTests, machinery=machinery)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -76,8 +76,9 @@ class LoaderTests(abc.LoaderTests):
|
|||
loader = self.machinery.ExtensionFileLoader('pkg', path)
|
||||
self.assertTrue(loader.is_package('pkg'))
|
||||
|
||||
Frozen_LoaderTests, Source_LoaderTests = util.test_both(
|
||||
LoaderTests, machinery=machinery)
|
||||
(Frozen_LoaderTests,
|
||||
Source_LoaderTests
|
||||
) = util.test_both(LoaderTests, machinery=machinery)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,10 @@ class PathHookTests:
|
|||
# exists.
|
||||
self.assertTrue(hasattr(self.hook(util.EXTENSIONS.path), 'find_module'))
|
||||
|
||||
Frozen_PathHooksTests, Source_PathHooksTests = util.test_both(
|
||||
PathHookTests, machinery=machinery)
|
||||
|
||||
(Frozen_PathHooksTests,
|
||||
Source_PathHooksTests
|
||||
) = util.test_both(PathHookTests, machinery=machinery)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue