summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_imp.py11
-rw-r--r--Lib/test/test_import.py10
2 files changed, 11 insertions, 10 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 7b85948..dc62423 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):
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 8be66a1..9c14e15 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -127,16 +127,6 @@ class ImportTests(unittest.TestCase):
finally:
del sys.path[0]
- @skip_if_dont_write_bytecode
- def test_bug7732(self):
- source = TESTFN + '.py'
- os.mkdir(source)
- try:
- self.assertRaisesRegex(ImportError, '^No module',
- imp.find_module, TESTFN, ["."])
- finally:
- os.rmdir(source)
-
def test_module_with_large_stack(self, module='longlist'):
# Regression test for http://bugs.python.org/issue561858.
filename = module + '.py'