◐ Shell
clean mode source ↗

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

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

...........s.............s........F..F................
======================================================================
FAIL: test_dict (test._test_multiprocessing.TestSyncManagerTypes.test_dict)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/_test_multiprocessing.py", line 5726, in test_dict
    self.assertEqual(len(o), 0)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1 != 0

======================================================================
FAIL: test_list (test._test_multiprocessing.TestSyncManagerTypes.test_list)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/.../dev/cpython/Lib/test/_test_multiprocessing.py", line 5708, in test_list
    self.assertEqual(len(o), 0)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1 != 0

----------------------------------------------------------------------
Ran 54 tests in 24.460s

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

...........s.............s............................
----------------------------------------------------------------------
Ran 54 tests in 24.588s

OK (skipped=2)