summaryrefslogtreecommitdiff
path: root/Lib/test/test_imp.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-07 13:26:53 -0400
committerBrett Cannon <brett@python.org>2013-06-07 13:26:53 -0400
commit997487d5d760a04bc6f5bcb8c881795ddd87e62b (patch)
tree6a91f18bbc86364c6316e89c8f8877c7d211b993 /Lib/test/test_imp.py
parentabb18af38fdbcce9971960edd5ee5ad0b225055a (diff)
downloadcpython-git-997487d5d760a04bc6f5bcb8c881795ddd87e62b.tar.gz
Issue #7732: Move an imp.find_module test from test_import to
test_imp.
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r--Lib/test/test_imp.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 7b85948e94..dc6242325f 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -273,6 +273,17 @@ class ImportTests(unittest.TestCase):
return
imp.load_module(name, None, *found[1:])
+ @unittest.skipIf(sys.dont_write_bytecode,
+ "test meaningful only when writing bytecode")
+ def test_bug7732(self):
+ source = support.TESTFN + '.py'
+ os.mkdir(source)
+ try:
+ self.assertRaisesRegex(ImportError, '^No module',
+ imp.find_module, support.TESTFN, ["."])
+ finally:
+ os.rmdir(source)
+
class ReloadTests(unittest.TestCase):