Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4b50c9

Browse files
committed
Somewhat clarify multiprocessing misadventure
1 parent602de0c commitd4b50c9

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-
assertGit.USE_SHELLisvalue
210-
211-
# FIXME: Check that mutation still works and raises the warning.
207+
def_get_value_in_current_process()->bool:
208+
returnGit.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
withProcessPoolExecutor(max_workers=1)asexecutor:
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+
assertmarshaled_valueisvalue
225222

226223

227224
_EXPECTED_DIR_SUBSET= {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp