Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout output #115568

Merged
merged 3 commits into from
Feb 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Lib/test/test_ctypes/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,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:
serhiy-storchaka marked this conversation as resolved.
Show resolved Hide resolved
# 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):
Expand Down
Loading