Skip to content

Commit

Permalink
fix: multiprocessing set_start_method wrong on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
hfudev committed Apr 24, 2024
1 parent f538abd commit 4bebed5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 6 additions & 1 deletion pytest-embedded/pytest_embedded/dut_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ def _drop_none_kwargs(kwargs: t.Dict[t.Any, t.Any]):
return {k: v for k, v in kwargs.items() if v is not None}


_ctx = multiprocessing.get_context()
if sys.platform == 'darwin':
_ctx = multiprocessing.get_context('fork')
else:
_ctx = multiprocessing.get_context()

_stdout = sys.__stdout__

dut_global_index = 0

PARAMETRIZED_FIXTURES_CACHE = {}
Expand Down
5 changes: 0 additions & 5 deletions pytest-embedded/pytest_embedded/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,11 +641,6 @@ def _pexpect_logfile(test_case_tempdir, logfile_extension, dut_index, dut_total)
return os.path.join(test_case_tempdir, f'{name}{logfile_extension}')


# Suppress UserWarning on resource_tracker.py
if sys.platform == 'darwin':
multiprocessing.set_start_method('fork')


@pytest.fixture
@multi_dut_generator_fixture
def msg_queue() -> MessageQueue: # kwargs passed by `multi_dut_generator_fixture()`
Expand Down

0 comments on commit 4bebed5

Please sign in to comment.