Skip to content

Commit

Permalink
tests: fix multiprocessing context for OSes missing start methods
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
  • Loading branch information
noxdafox committed Sep 29, 2024
1 parent d02d231 commit 54dcb93
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/test_asynchronous_process_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
raise Exception(mp_context.get_start_method())
except RuntimeError: # child process
pass
else:
mp_context = multiprocessing.get_context()


def not_decorated(argument, keyword_argument=0):
Expand Down
2 changes: 2 additions & 0 deletions test/test_asynchronous_process_forkserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
raise Exception(mp_context.get_start_method())
except RuntimeError: # child process
pass
else:
mp_context = multiprocessing.get_context()


def not_decorated(argument, keyword_argument=0):
Expand Down
2 changes: 2 additions & 0 deletions test/test_asynchronous_process_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
raise Exception(mp_context.get_start_method())
except RuntimeError: # child process
pass
else:
mp_context = multiprocessing.get_context()


def not_decorated(argument, keyword_argument=0):
Expand Down
2 changes: 2 additions & 0 deletions test/test_concurrent_process_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
raise Exception(mp_context.get_start_method())
except RuntimeError: # child process
pass
else:
mp_context = multiprocessing.get_context()


def not_decorated(argument, keyword_argument=0):
Expand Down
2 changes: 2 additions & 0 deletions test/test_concurrent_process_forkserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
raise Exception(mp_context.get_start_method())
except RuntimeError: # child process
pass
else:
mp_context = multiprocessing.get_context()


def not_decorated(argument, keyword_argument=0):
Expand Down
2 changes: 2 additions & 0 deletions test/test_concurrent_process_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
raise Exception(mp_context.get_start_method())
except RuntimeError: # child process
pass
else:
mp_context = multiprocessing.get_context()


def not_decorated(argument, keyword_argument=0):
Expand Down

0 comments on commit 54dcb93

Please sign in to comment.