Skip to content

Commit 99cf022

Browse files
gh-69134: Wait until mapped in SimpleDialog keyboard tests
The SimpleDialog tests generate key events after focus_force(), which on Windows are dropped until the toplevel is mapped. Wait until it is mapped, as GH-152599 did for the other keyboard tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 38df997 commit 99cf022

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_tkinter/test_simpledialog.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def create(self, **kw):
2323
kw.setdefault('cancel', 1)
2424
d = SimpleDialog(self.root, **kw)
2525
self.addCleanup(lambda: d.root.winfo_exists() and d.root.destroy())
26+
# On Windows the generated key events are dropped until the
27+
# toplevel is mapped (gh-69134).
28+
self.require_mapped(d.root)
2629
return d
2730

2831
# --- Widget set and appearance ---

0 commit comments

Comments
 (0)