Issue #21503: Use test_both() consistently in test_importlib.

This commit is contained in:
Eric Snow 2014-05-16 11:40:40 -06:00
parent d50cee2045
commit 3497c0bf95
30 changed files with 526 additions and 428 deletions

View file

@ -1,7 +1,7 @@
from .. import abc
from .. import util
frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
machinery = util.import_importlib('importlib.machinery')
import sys
import types
@ -65,8 +65,9 @@ def test_already_imported(self):
self.assertEqual(cm.exception.name, module_name)
Frozen_LoaderTests, Source_LoaderTests = util.test_both(LoaderTests,
machinery=[frozen_machinery, source_machinery])
(Frozen_LoaderTests,
Source_LoaderTests
) = util.test_both(LoaderTests, machinery=machinery)
@unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module')
@ -98,9 +99,10 @@ def test_not_builtin(self):
method(util.BUILTINS.bad_name)
self.assertRaises(util.BUILTINS.bad_name)
Frozen_InspectLoaderTests, Source_InspectLoaderTests = util.test_both(
InspectLoaderTests,
machinery=[frozen_machinery, source_machinery])
(Frozen_InspectLoaderTests,
Source_InspectLoaderTests
) = util.test_both(InspectLoaderTests, machinery=machinery)
if __name__ == '__main__':