| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add wait_until_mapped() and AbstractTkTest.require_mapped() to test_tkinter.support and use them to guard the assertions that need a widget to be actually mapped (winfo_width(), identify(), coords(), ...). This avoids intermittent failures under window managers that do not map the widget promptly, without skipping the unrelated checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
Sorry, something went wrong.
|
GH-152516 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict. cherry_picker 0fff6bd86cf0224152c509e295d3cbbd209098f3 3.13 |
Sorry, something went wrong.
|
GH-152517 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-152518 is a backport of this pull request to the 3.23 branch. |
Sorry, something went wrong.
|
GH-152518 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…get (GH-152499) (GH-152517) Add wait_until_mapped() and AbstractTkTest.require_mapped() to test_tkinter.support and use them to guard the assertions that need a widget to be actually mapped (winfo_width(), identify(), coords(), ...). This avoids intermittent failures under window managers that do not map the widget promptly, without skipping the unrelated checks. (cherry picked from commit 0fff6bd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…get (GH-152499) (GH-152518) Add wait_until_mapped() and AbstractTkTest.require_mapped() to test_tkinter.support and use them to guard the assertions that need a widget to be actually mapped (winfo_width(), identify(), coords(), ...). This avoids intermittent failures under window managers that do not map the widget promptly, without skipping the unrelated checks. (cherry picked from commit 0fff6bd) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…get (GH-152499) (GH-152516) Add wait_until_mapped() and AbstractTkTest.require_mapped() to test_tkinter.support and use them to guard the assertions that need a widget to be actually mapped (winfo_width(), identify(), coords(), ...). This avoids intermittent failures under window managers that do not map the widget promptly, without skipping the unrelated checks. (cherry picked from commit 0fff6bd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Several ttk and tkinter tests query realized geometry (winfo_width(), identify(), coords(), place_info(), ...) right after a bare update(), which does not guarantee that the window manager has mapped and sized the widget. Under a tiling window manager or a headless/contended display the widget can still have a 1x1 size, so identify() returns the empty string and coordinate-based assertions fail intermittently.
This adds a wait_until_mapped() helper (and an AbstractTkTest.require_mapped() wrapper) to test_tkinter.support that waits, with a bounded timeout, for the widget to be mapped with a non-trivial size. Unlike Misc.wait_visibility() it never blocks indefinitely (see bpo-40722).
It is used to guard only the assertions that need a mapped widget, so the remaining checks still run, and the empty string that several identify() tests accepted solely to tolerate an unmapped widget is dropped.