mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-92886: Fix tests that fail when running with optimizations (-O) in test_zipimport.py (GH-93236)
(cherry picked from commit 484a2357c8)
Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
This commit is contained in:
parent
9fafc0acf7
commit
65e2a940fa
2 changed files with 5 additions and 1 deletions
|
|
@ -653,7 +653,10 @@ def test(val):
|
||||||
sys.path.insert(0, TEMP_ZIP)
|
sys.path.insert(0, TEMP_ZIP)
|
||||||
mod = importlib.import_module(TESTMOD)
|
mod = importlib.import_module(TESTMOD)
|
||||||
self.assertEqual(mod.test(1), 1)
|
self.assertEqual(mod.test(1), 1)
|
||||||
|
if __debug__:
|
||||||
self.assertRaises(AssertionError, mod.test, False)
|
self.assertRaises(AssertionError, mod.test, False)
|
||||||
|
else:
|
||||||
|
self.assertEqual(mod.test(0), 0)
|
||||||
|
|
||||||
def testImport_WithStuff(self):
|
def testImport_WithStuff(self):
|
||||||
# try importing from a zipfile which contains additional
|
# try importing from a zipfile which contains additional
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Fixing tests that fail when running with optimizations (``-O``) in ``test_zipimport.py``
|
||||||
Loading…
Add table
Add a link
Reference in a new issue