]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106368: Argument clinic tests: improve error message when `expect_success()` fails...
authorAlex Waygood <Alex.Waygood@Gmail.com>
Thu, 3 Aug 2023 21:26:14 +0000 (22:26 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Aug 2023 21:26:14 +0000 (21:26 +0000)
Lib/test/test_clinic.py

index 2f945663618722bbf59734f02095644b5b1e0f3d..3aa41631d3637a8c3d97170ab4e2dc49d3dff088 100644 (file)
@@ -1680,7 +1680,8 @@ class ClinicExternalTest(TestCase):
 
     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