mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 00:14:46 +00:00
Simplify and speed up multiprocessing
This commit is contained in:
parent
348722d77b
commit
109f5f8888
4 changed files with 64 additions and 105 deletions
|
|
@ -20,7 +20,7 @@ def test_oserrors_cause_serial_fall_back():
|
|||
"""Verify that OSErrors will cause the Manager to fallback to serial."""
|
||||
err = OSError(errno.ENOSPC, 'Ominous message about spaceeeeee')
|
||||
style_guide = style_guide_mock()
|
||||
with mock.patch('multiprocessing.Queue', side_effect=err):
|
||||
with mock.patch('_multiprocessing.SemLock', side_effect=err):
|
||||
manager = checker.Manager(style_guide, [], [])
|
||||
assert manager.using_multiprocessing is False
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ def test_oserrors_are_reraised(is_windows):
|
|||
"""Verify that OSErrors will cause the Manager to fallback to serial."""
|
||||
err = OSError(errno.EAGAIN, 'Ominous message')
|
||||
style_guide = style_guide_mock()
|
||||
with mock.patch('multiprocessing.Queue', side_effect=err):
|
||||
with mock.patch('_multiprocessing.SemLock', side_effect=err):
|
||||
with pytest.raises(OSError):
|
||||
checker.Manager(style_guide, [], [])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue