From: Serhiy Storchaka Date: Sun, 5 Jul 2026 11:42:24 +0000 (+0300) Subject: [3.15] gh-69134: Wait until mapped in SimpleDialog keyboard tests (GH-152690) (GH... X-Git-Tag: v3.15.0b4~112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0416fcd7cf454b3b8d87467f3b6442a647136a1a;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-69134: Wait until mapped in SimpleDialog keyboard tests (GH-152690) (GH-153104) 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 --- diff --git a/Lib/test/test_tkinter/test_simpledialog.py b/Lib/test/test_tkinter/test_simpledialog.py index 942b7ebf7120..64edbb645bc8 100644 --- a/Lib/test/test_tkinter/test_simpledialog.py +++ b/Lib/test/test_tkinter/test_simpledialog.py @@ -49,6 +49,7 @@ class SimpleDialogTest(AbstractTkTest, unittest.TestCase): def test_return_activates_default(self): # 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('') @@ -59,6 +60,7 @@ class SimpleDialogTest(AbstractTkTest, unittest.TestCase): # With no default button, 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 = []