diff options
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r-- | Lib/test/test_imp.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 6dd1e21..233d3da 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -306,11 +306,24 @@ class PEP3147Tests(unittest.TestCase): os.sep.join(('.', 'pep3147', '__init__.py'))) +class NullImporterTests(unittest.TestCase): + @unittest.skipIf(support.TESTFN_UNENCODEABLE is None, + "Need an undecodeable filename") + def test_unencodeable(self): + name = support.TESTFN_UNENCODEABLE + os.mkdir(name) + try: + self.assertRaises(ImportError, imp.NullImporter, name) + finally: + os.rmdir(name) + + def test_main(): tests = [ ImportTests, PEP3147Tests, ReloadTests, + NullImporterTests, ] try: import _thread |