Commit 703faa32 authored by Zsolt Dollenstein's avatar Zsolt Dollenstein
Browse files

Fix mono test

parent 6ea76e9b
Loading
Loading
Loading
Loading
+4 −5
Changes for tests/test_black.py: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -1363,16 +1363,15 @@ def test_write_cache_write_fail(self) -> None:
            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)