]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 17 Feb 2024 14:41:46 +0000 (15:41 +0100)
committerGitHub <noreply@github.com>
Sat, 17 Feb 2024 14:41:46 +0000 (14:41 +0000)
(cherry picked from commit 265548a4eaaebc3fb379f85f2a919848927f09e5)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Lib/test/test_ctypes/test_callbacks.py

index a9c6524b4d4ee798deb4177e085a346d9e7e2035..2bfabeec7ae4aa5d4e72f892fd6e261c813996e1 100644 (file)
@@ -151,9 +151,10 @@ class Callbacks(unittest.TestCase):
             print(f"a={a}, b={b}, c={c}")
             return c
         dll = cdll[_ctypes_test.__file__]
-        # With no fix for i38748, the next line will raise OSError and cause the test to fail.
-        self.assertEqual(dll._test_i38748_runCallback(callback, 5, 10), 15)
-
+        with support.captured_stdout() as out:
+            # With no fix for i38748, the next line will raise OSError and cause the test to fail.
+            self.assertEqual(dll._test_i38748_runCallback(callback, 5, 10), 15)
+            self.assertEqual(out.getvalue(), "a=5, b=10, c=15\n")
 
 @need_symbol('WINFUNCTYPE')
 class StdcallCallbacks(Callbacks):