From 703faa323391165d13ee41d3ed4c417e62cd0ca2 Mon Sep 17 00:00:00 2001 From: Zsolt Dollenstein Date: Fri, 8 May 2020 16:13:42 +0100 Subject: [PATCH] Fix mono test --- tests/test_black.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) -- 2.39.5