diff options
author | Brett Cannon <brett@python.org> | 2013-10-18 19:40:11 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-10-18 19:40:11 (GMT) |
commit | 1340049f65d01b2ea7d3ee13d19eae5939726cf7 (patch) | |
tree | 0911f763d690229702f1719de9293d4071cbfb8b /Lib/test/test_importlib/util.py | |
parent | 6a57dd86353813cf9fe6a21fc5e08d558b70ed43 (diff) | |
download | cpython-1340049f65d01b2ea7d3ee13d19eae5939726cf7.zip cpython-1340049f65d01b2ea7d3ee13d19eae5939726cf7.tar.gz cpython-1340049f65d01b2ea7d3ee13d19eae5939726cf7.tar.bz2 |
Issue #16803: Move test_importlib.test_util to use both frozen and
source code.
Diffstat (limited to 'Lib/test/test_importlib/util.py')
-rw-r--r-- | Lib/test/test_importlib/util.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py index 91a6361..cb08ce6 100644 --- a/Lib/test/test_importlib/util.py +++ b/Lib/test/test_importlib/util.py @@ -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). |