From: Zsolt Dollenstein Date: Fri, 8 May 2020 15:13:42 +0000 (+0100) Subject: Fix mono test X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/703faa323391165d13ee41d3ed4c417e62cd0ca2 Fix mono test --- diff --git a/tests/test_black.py b/tests/test_black.py index baa44ab..40f4add 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1363,16 +1363,15 @@ class BlackTestCase(unittest.TestCase): mock.side_effect = OSError black.write_cache({}, [], mode) - @patch("black.ProcessPoolExecutor", autospec=True) - def test_works_in_mono_process_only_environment(self, executor: MagicMock) -> None: - self.skipTest("this test fails when run with the rest of the suite") - executor.side_effect = OSError() + @event_loop(close=False) + @patch("black.ProcessPoolExecutor", MagicMock(side_effect=OSError)) + def test_works_in_mono_process_only_environment(self) -> None: with cache_dir() as workspace: for f in [ (workspace / "one.py").resolve(), (workspace / "two.py").resolve(), ]: - f.write_text("print('hello')") + f.write_text('print("hello")\n') self.invokeBlack([str(workspace)]) @event_loop(close=False)