Only use multiprocessing when the method is fork

In python3.8 on macos and in all versions on windows the multiprocessing
method is `spawn` which does not preserve class state.
This commit is contained in:
Anthony Sottile 2019-10-28 09:17:59 -07:00
parent d599950e6e
commit 51f32bbe93
4 changed files with 15 additions and 45 deletions

View file

@ -34,7 +34,7 @@ def test_oserrors_cause_serial_fall_back():
assert serial.call_count == 1
@mock.patch('flake8.utils.is_windows', return_value=False)
@mock.patch('flake8.checker._multiprocessing_is_fork', return_value=True)
def test_oserrors_are_reraised(is_windows):
"""Verify that unexpected OSErrors will cause the Manager to reraise."""
err = OSError(errno.EAGAIN, 'Ominous message')