mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
#11420: make test suite pass with -B/DONTWRITEBYTECODE set. Initial patch by Thomas Wouters.
This commit is contained in:
parent
58e1e50be1
commit
c28f6fa505
6 changed files with 52 additions and 29 deletions
|
|
@ -153,9 +153,11 @@ class ImportTests(unittest.TestCase):
|
|||
mod = imp.load_source(temp_mod_name, temp_mod_name + '.py')
|
||||
self.assertEqual(mod.a, 1)
|
||||
|
||||
mod = imp.load_compiled(
|
||||
temp_mod_name, imp.cache_from_source(temp_mod_name + '.py'))
|
||||
self.assertEqual(mod.a, 1)
|
||||
if not sys.dont_write_bytecode:
|
||||
mod = imp.load_compiled(
|
||||
temp_mod_name,
|
||||
imp.cache_from_source(temp_mod_name + '.py'))
|
||||
self.assertEqual(mod.a, 1)
|
||||
|
||||
if not os.path.exists(test_package_name):
|
||||
os.mkdir(test_package_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue