summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Podoprigora <kirill.bast9@mail.ru>2024-02-17 13:17:55 (GMT)
committerGitHub <noreply@github.com>2024-02-17 13:17:55 (GMT)
commit265548a4eaaebc3fb379f85f2a919848927f09e5 (patch)
tree53cffed4911aa7df2871dc8d69e26b7177328516
parent04005f5021a17b191dae319faaadf1c942af3fe9 (diff)
downloadcpython-265548a4eaaebc3fb379f85f2a919848927f09e5.zip
cpython-265548a4eaaebc3fb379f85f2a919848927f09e5.tar.gz
cpython-265548a4eaaebc3fb379f85f2a919848927f09e5.tar.bz2
gh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout output (GH-115568)
-rw-r--r--Lib/test/test_ctypes/test_callbacks.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_ctypes/test_callbacks.py b/Lib/test/test_ctypes/test_callbacks.py
index 19f4158..64f92ff 100644
--- a/Lib/test/test_ctypes/test_callbacks.py
+++ b/Lib/test/test_ctypes/test_callbacks.py
@@ -148,9 +148,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")
if hasattr(ctypes, 'WINFUNCTYPE'):
class StdcallCallbacks(Callbacks):