Skip to content

Commit d4b50c9

Browse files
committed
Somewhat clarify multiprocessing misadventure
1 parent 602de0c commit d4b50c9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/deprecation/test_cmd_git.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,8 @@ def test_use_shell_cannot_set_on_instance(
204204
instance.USE_SHELL = value
205205

206206

207-
def _check_use_shell_in_worker(value: bool) -> None:
208-
# USE_SHELL should have the value set in the parent before starting the worker.
209-
assert Git.USE_SHELL is value
210-
211-
# FIXME: Check that mutation still works and raises the warning.
207+
def _get_value_in_current_process() -> bool:
208+
return Git.USE_SHELL
212209

213210

214211
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
@@ -220,8 +217,8 @@ def test_use_shell_preserved_in_multiprocessing(
220217
"""The USE_SHELL class attribute pickles accurately for multiprocessing."""
221218
Git.USE_SHELL = value
222219
with ProcessPoolExecutor(max_workers=1) as executor:
223-
# Calling result() marshals any exception back to this process and raises it.
224-
executor.submit(_check_use_shell_in_worker, value).result()
220+
marshaled_value = executor.submit(_get_value_in_current_process).result()
221+
assert marshaled_value is value
225222

226223

227224
_EXPECTED_DIR_SUBSET = {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy