Skip to content

v3.5.0: fix(tests): make test_unpicklable_attribute pass on Python 3.13+

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Oct 08:26
Python 3.13 changed multiprocessing.spawn.get_preparation_data to call
get_start_method(allow_none=True). The test monkey patches
multiprocessing.get_start_method with a zero-argument lambda so that
run_check sees the context's start method, which now raises
TypeError when the spawn context starts the child process.

- Accept the allow_none keyword in the patched function and bind the
  loop variable explicitly rather than via closure
- Fix tearDown: setUp stored the *result* of get_start_method() instead
  of the function itself, so the original was never restored
- Run each start method as a subTest and assert the child exited 0