Fix mono test

This commit is contained in:
Zsolt Dollenstein 2020-05-08 16:13:42 +01:00
parent 6ea76e9b4f
commit 703faa3233

View File

@ -1363,16 +1363,15 @@ def test_write_cache_write_fail(self) -> None:
mock.side_effect = OSError mock.side_effect = OSError
black.write_cache({}, [], mode) black.write_cache({}, [], mode)
@patch("black.ProcessPoolExecutor", autospec=True) @event_loop(close=False)
def test_works_in_mono_process_only_environment(self, executor: MagicMock) -> None: @patch("black.ProcessPoolExecutor", MagicMock(side_effect=OSError))
self.skipTest("this test fails when run with the rest of the suite") def test_works_in_mono_process_only_environment(self) -> None:
executor.side_effect = OSError()
with cache_dir() as workspace: with cache_dir() as workspace:
for f in [ for f in [
(workspace / "one.py").resolve(), (workspace / "one.py").resolve(),
(workspace / "two.py").resolve(), (workspace / "two.py").resolve(),
]: ]:
f.write_text("print('hello')") f.write_text('print("hello")\n')
self.invokeBlack([str(workspace)]) self.invokeBlack([str(workspace)])
@event_loop(close=False) @event_loop(close=False)