diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 2f945663618722..3aa41631d3637a 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -1680,7 +1680,8 @@ def run_clinic(self, *args): def expect_success(self, *args): out, err, code = self.run_clinic(*args) - self.assertEqual(code, 0, f"Unexpected failure: {args=}") + if code != 0: + self.fail("\n".join([f"Unexpected failure: {args=}", out, err])) self.assertEqual(err, "") return out