diff options
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r-- | Lib/test/test_import.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 2abf5b2..4325005 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -415,6 +415,14 @@ class ImportTests(unittest.TestCase): finally: rmtree(dir_name) + def test_fromlist_type(self): + with self.assertRaises(TypeError) as cm: + __import__('encodings', fromlist=[u'aliases']) + self.assertIn('must be str, not unicode', str(cm.exception)) + with self.assertRaises(TypeError) as cm: + __import__('encodings', fromlist=[1]) + self.assertIn('must be str, not int', str(cm.exception)) + class PycRewritingTests(unittest.TestCase): # Test that the `co_filename` attribute on code objects always points |