Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65e2a94

Browse files
gh-92886: Fix tests that fail when running with optimizations (-O) intest_zipimport.py (GH-93236)
(cherry picked from commit484a235)Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
1 parent9fafc0a commit65e2a94

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎Lib/test/test_zipimport.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,10 @@ def test(val):
653653
sys.path.insert(0,TEMP_ZIP)
654654
mod=importlib.import_module(TESTMOD)
655655
self.assertEqual(mod.test(1),1)
656-
self.assertRaises(AssertionError,mod.test,False)
656+
if__debug__:
657+
self.assertRaises(AssertionError,mod.test,False)
658+
else:
659+
self.assertEqual(mod.test(0),0)
657660

658661
deftestImport_WithStuff(self):
659662
# try importing from a zipfile which contains additional
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixing tests that fail when running with optimizations (``-O``) in ``test_zipimport.py``

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp