Skip to content

gh-92886: Fixing tests that fail when running with optimizations (-O) in test_zipimport.py - #93236

Merged
brettcannon merged 4 commits into
python:mainfrom
jackh-ncl:92886-zipimport
Jun 10, 2022
Merged

brettcannon merged 4 commits into
python:mainfrom
jackh-ncl:92886-zipimport

Conversation

@jackh-ncl

Copy link
Copy Markdown
Contributor

#92886

Before:

$ ./python.exe -Om unittest test.test_zipimport 

................F...................s............F...................s...
======================================================================
FAIL: testDefaultOptimizationLevel (test.test_zipimport.CompressedZipImportTestCase.testDefaultOptimizationLevel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/test_zipimport.py", line 657, in testDefaultOptimizationLevel
    self.assertRaises(AssertionError, mod.test, False)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: AssertionError not raised by test

======================================================================
FAIL: testDefaultOptimizationLevel (test.test_zipimport.UncompressedZipImportTestCase.testDefaultOptimizationLevel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/test_zipimport.py", line 657, in testDefaultOptimizationLevel
    self.assertRaises(AssertionError, mod.test, False)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: AssertionError not raised by test

----------------------------------------------------------------------
Ran 73 tests in 0.073s

FAILED (failures=2, skipped=2)

After:

./python.exe -Om unittest test.test_zipimport

....................................s................................s...
----------------------------------------------------------------------
Ran 73 tests in 0.065s

OK (skipped=2)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants