◐ Shell
clean mode source ↗

gh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_py_compile.py` by jackh-ncl · Pull Request #93235 · python/cpython

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

....FF......s............s......
======================================================================
FAIL: test_stdin (test.test_py_compile.PyCompileCLITestCase.test_stdin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/test_py_compile.py", line 252, in test_stdin
    self.assertTrue(os.path.exists(self.cache_path))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

======================================================================
FAIL: test_with_files (test.test_py_compile.PyCompileCLITestCase.test_with_files)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/test_py_compile.py", line 259, in test_with_files
    self.assertTrue(os.path.exists(self.cache_path))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

----------------------------------------------------------------------
Ran 32 tests in 0.322s

FAILED (failures=2, skipped=2)
./python.exe -Om unittest test.test_py_compile

............s............s......
----------------------------------------------------------------------
Ran 32 tests in 0.307s

OK (skipped=2)