test_virtual_events and test_selection_event generate key events after
focus_force(). On Windows these are only delivered once the toplevel is
mapped, so they could be dropped and the test fail. Wait until the
widget is mapped, as the other GUI tests already do.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
lb = self.create(selectmode='browse', exportselection=False)
lb.insert(0, *('el%d' % i for i in range(5)))
lb.pack()
- lb.update()
+ self.require_mapped(lb)
events = []
lb.bind('<<ListboxSelect>>', lambda e: events.append(lb.curselection()))
lb.focus_force()
self.tv.insert(parent, 'end')
item2 = self.tv.insert('', 'end')
self.tv.pack()
- self.tv.update()
+ self.require_mapped(self.tv)
selects, opens, closes = [], [], []
self.tv.bind('<<TreeviewSelect>>',
lambda e: selects.append(self.tv.selection()))