Title: gh-69134: Harden tkinter GUI tests that depend on a mapped widget by serhiy-storchaka · Pull Request #152499 · python/cpython · GitHub
Open Graph Title: gh-69134: Harden tkinter GUI tests that depend on a mapped widget by serhiy-storchaka · Pull Request #152499 · python/cpython
X Title: gh-69134: Harden tkinter GUI tests that depend on a mapped widget by serhiy-storchaka · Pull Request #152499 · python/cpython
Description: 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. Issue: gh-69134
Open Graph Description: 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 mapp...
X Description: 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 mapp...
Opengraph URL: https://github.com/python/cpython/pull/152499
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a251306b-2334-4492-b9e7-d63363c0f3d8 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DA16:203A5F:38E51B:4DCE56:6A5374F8 |
| html-safe-nonce | 54a9b85f946ee4c2214da92eb3df8b430857b9bbd61f68b5f3fe8844cf16c0dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTE2OjIwM0E1RjozOEU1MUI6NERDRTU2OjZBNTM3NEY4IiwidmlzaXRvcl9pZCI6IjQ5NzY1MzE5NjkxMTcxMDY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d7365dbda2a4afcbae80c056c2e5d0027033ea0de5559960798e56e28846717f |
| hovercard-subject-tag | pull_request:3951215751 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/152499/files |
| twitter:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| og:image:alt | 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 mapp... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width