X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/8d6d92aa5b5248b5ff70ebf7977f8af5cbcb10b9..c5f87fb4ef49a0e0e497c75dffa2260a9cc33585:/tests/test_black.py diff --git a/tests/test_black.py b/tests/test_black.py index 11bba1f..8d424ef 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1354,6 +1354,17 @@ 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: + executor.side_effect = OSError() + with cache_dir() as workspace: + for f in [ + (workspace / "one.py").resolve(), + (workspace / "two.py").resolve(), + ]: + f.write_text("print('hello')") + self.invokeBlack([str(workspace)]) + @event_loop(close=False) def test_check_diff_use_together(self) -> None: with cache_dir():