https://github.com/python/cpython/commit/18735fdbea61248919106d9d3d9428e1552ea62a
commit: 18735fdbea61248919106d9d3d9428e1552ea62a
branch: 3.13
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-05T11:35:04Z
summary:

[3.13] gh-69134: Wait until mapped in SimpleDialog keyboard tests (GH-152690) 
(GH-153106)

The SimpleDialog keyboard tests generate key events after focus_force(),
which on Windows are dropped until the toplevel is mapped, so they could
fail intermittently (seen on the Windows10 buildbot as
test_return_no_default).  Wait until the window is mapped in these tests,
as GH-152599 did for the other keyboard tests.

(cherry picked from commit 7d619c2fea131722d0bfdad150c081c44cc0abd7)

Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_tkinter/test_simpledialog.py

diff --git a/Lib/test/test_tkinter/test_simpledialog.py 
b/Lib/test/test_tkinter/test_simpledialog.py
index 942b7ebf7120b3a..64edbb645bc80fa 100644
--- a/Lib/test/test_tkinter/test_simpledialog.py
+++ b/Lib/test/test_tkinter/test_simpledialog.py
@@ -49,6 +49,7 @@ def test_default_button(self):
     def test_return_activates_default(self):
         # <Return> invokes the default button.
         d = self.create()  # default 0
+        self.require_mapped(d.root)
         d.root.focus_force()
         d.root.update()
         d.root.event_generate('<Return>')
@@ -59,6 +60,7 @@ def test_return_no_default(self):
         # With no default button, <Return> rings the bell and leaves the dialog
         # open instead of activating a button.
         d = self.create(default=None)
+        self.require_mapped(d.root)
         d.root.focus_force()
         d.root.update()
         bells = []

_______________________________________________
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