mirror of
https://github.com/python/cpython.git
synced 2025-11-15 00:00:00 +00:00
Issue #7732: Move an imp.find_module test from test_import to
test_imp.
This commit is contained in:
parent
abb18af38f
commit
997487d5d7
2 changed files with 11 additions and 10 deletions
|
|
@ -273,6 +273,17 @@ class ImportTests(unittest.TestCase):
|
||||||
return
|
return
|
||||||
imp.load_module(name, None, *found[1:])
|
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):
|
class ReloadTests(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,16 +127,6 @@ class ImportTests(unittest.TestCase):
|
||||||
finally:
|
finally:
|
||||||
del sys.path[0]
|
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'):
|
def test_module_with_large_stack(self, module='longlist'):
|
||||||
# Regression test for http://bugs.python.org/issue561858.
|
# Regression test for http://bugs.python.org/issue561858.
|
||||||
filename = module + '.py'
|
filename = module + '.py'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue