From 6ea76e9b4f42e538540baa236875c94c9dc07697 Mon Sep 17 00:00:00 2001 From: Zsolt Dollenstein Date: Fri, 8 May 2020 16:12:52 +0100 Subject: [PATCH] Improve error messages from BlackRunner --- tests/test_black.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_black.py b/tests/test_black.py index 8fafabd..baa44ab 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -162,7 +162,12 @@ class BlackTestCase(unittest.TestCase): self.assertEqual( result.exit_code, exit_code, - msg=f"Failed with args: {args}. Stderr: {runner.stderr_bytes.decode()!r}", + msg=( + f"Failed with args: {args}\n" + f"stdout: {runner.stdout_bytes.decode()!r}\n" + f"stderr: {runner.stderr_bytes.decode()!r}\n" + f"exception: {result.exception}" + ), ) @patch("black.dump_to_file", dump_to_stderr) -- 2.39.5