Issue #16803: Move test_importlib.test_util to use both frozen and

source code.
This commit is contained in:
Brett Cannon 2013-10-18 15:40:11 -04:00
parent 6a57dd8635
commit 1340049f65
2 changed files with 96 additions and 50 deletions

View file

@ -15,6 +15,17 @@ def import_importlib(module_name):
return frozen, source
def test_both(test_class, **kwargs):
frozen_tests = types.new_class('Frozen_'+test_class.__name__,
(test_class, unittest.TestCase))
source_tests = types.new_class('Source_'+test_class.__name__,
(test_class, unittest.TestCase))
for attr, (frozen_value, source_value) in kwargs.items():
setattr(frozen_tests, attr, frozen_value)
setattr(source_tests, attr, source_value)
return frozen_tests, source_tests
CASE_INSENSITIVE_FS = True
# Windows is the only OS that is *always* case-insensitive
# (OS X *can* be case-sensitive).