https://github.com/python/cpython/commit/6e89292f2c995f0708a9587efb0677166ab5fa55
commit: 6e89292f2c995f0708a9587efb0677166ab5fa55
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-02-17T14:41:46Z
summary:

[3.12] gh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption 
stdout output (GH-115568) (GH-115609)

(cherry picked from commit 265548a4eaaebc3fb379f85f2a919848927f09e5)

Co-authored-by: Kirill Podoprigora <[email protected]>

files:
M Lib/test/test_ctypes/test_callbacks.py

diff --git a/Lib/test/test_ctypes/test_callbacks.py 
b/Lib/test/test_ctypes/test_callbacks.py
index a9c6524b4d4ee7..2bfabeec7ae4aa 100644
--- a/Lib/test/test_ctypes/test_callbacks.py
+++ b/Lib/test/test_ctypes/test_callbacks.py
@@ -151,9 +151,10 @@ def callback(a, b):
             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):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to