Skip to content

gh-92886: Fix tests that fail when running with optimizations (-O) in _test_multiprocessing.py - #93233

Merged
iritkatriel merged 3 commits into
python:mainfrom
jackh-ncl:92886-multiprocessing
Oct 19, 2022
Merged

gh-92886: Fix tests that fail when running with optimizations (-O) in _test_multiprocessing.py#93233
iritkatriel merged 3 commits into
python:mainfrom
jackh-ncl:92886-multiprocessing

Conversation

@jackh-ncl

@jackh-ncljackh-ncl commented May 25, 2022

Copy link
Copy Markdown
Contributor

#92886

Before:

$ ./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)

After:

$ ./python.exe -Om unittest test._test_multiprocessing
...........s.............s............................
----------------------------------------------------------------------
Ran 54 tests in 24.588s
OK (skipped=2)

@bedevere-bot

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@jackh-ncl
jackh-ncl marked this pull request as ready for review May 25, 2022 22:40
@jackh-ncl

Copy link
Copy Markdown
ContributorAuthor

Could be worth changing the rest of the assertions in this file?

@iritkatrieliritkatriel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@iritkatrieliritkatriel changed the title gh-92886: Fixing tests that fail when running with optimizations (-O) in _test_multiprocessing.pygh-92886: Fix tests that fail when running with optimizations (-O) in _test_multiprocessing.pyOct 18, 2022
@iritkatriel
iritkatriel merged commit a3be874 into python:mainOct 19, 2022
carljm added a commit to carljm/cpython that referenced this pull request Oct 20, 2022
* main: (40 commits)
pythongh-98461: Fix source location in comprehensions bytecode (pythonGH-98464)
pythongh-98421: Clean Up PyObject_Print (pythonGH-98422)
pythongh-98360: multiprocessing now spawns children on Windows with correct argv[0] in virtual environments (pythonGH-98462)
CODEOWNERS: Become a typing code owner (python#98480)
[doc] Improve logging cookbook example. (pythonGH-98481)
Add more tkinter.Canvas tests (pythonGH-98475)
pythongh-95023: Added os.setns and os.unshare functions (python#95046)
pythonGH-98363: Presize the list for batched() (pythonGH-98419)
pythongh-98374: Suppress ImportError for invalid query for help() command. (pythongh-98450)
typing tests: `_overload_dummy` raises `NotImplementedError`, not `RuntimeError` (python#98351)
pythongh-98354: Add unicode check for 'name' attribute in _imp_create_builtin (pythonGH-98412)
pythongh-98257: Make _PyEval_SetTrace() reentrant (python#98258)
pythongh-98414: py.exe launcher does not use defaults for -V:company/ option (pythonGH-98460)
pythongh-98417: Store int_max_str_digits on the Interpreter State (pythonGH-98418)
Doc: Remove title text from internal links (python#98409)
[doc] Refresh the venv introduction documentation, and correct the statement about VIRTUAL_ENV (pythonGH-98350)
Docs: Bump sphinx-lint and fix unbalanced inline literal markup (python#98441)
pythongh-92886: Replace assertion statements in `handlers.BaseHandler` to support running with optimizations (`-O`) (pythonGH-93231)
pythongh-92886: Fix tests that fail when running with optimizations (`-O`) in `_test_multiprocessing.py` (pythonGH-93233)
pythongh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_py_compile.py` (pythonGH-93235)
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jackh-ncl@bedevere-bot@iritkatriel@vstinner