gh-153741: Harden IDLE GUI tests for newer Tk and display scaling#153742
Merged
terryjreedy merged 1 commit intoJul 22, 2026
Conversation
Use <MouseWheel> instead of the X11 <Button-4>/<Button-5> events, which Tk 8.7 dropped, in test_sidebar's test_mousewheel. In test_configdialog, assert the 'disabled' state flag alone instead of the exact ttk state tuple (which transient pointer states break), and restore the tests' method masks with addCleanup(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
|
After merging this, I will move the x11_buttons comment and definition to util.py in a followup, to be used in a binding function. |
|
Thanks @serhiy-storchaka for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-154404 is a backport of this pull request to the 3.15 branch. |
|
GH-154405 is a backport of this pull request to the 3.14 branch. |
|
GH-154406 is a backport of this pull request to the 3.13 branch. |
terryjreedy
pushed a commit
that referenced
this pull request
Jul 22, 2026
…ing (GH-153742) (#154406) gh-153741: Harden IDLE GUI tests for newer Tk and display scaling (GH-153742) In test_sidebar.test_mousewheel, only use the X11 <Button-4>/<Button-5> events when testing on x11 Tk before 8.7. Otherwise, use <Mousewheel> as on other systems. In test_configdialog, assert the 'disabled' state flag alone instead of the exact ttk state tuple (which transient pointer states break), and restore the tests' method masks with addCleanup(). (cherry picked from commit a2581eb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
terryjreedy
pushed a commit
that referenced
this pull request
Jul 22, 2026
…ing (GH-153742) (#154404) gh-153741: Harden IDLE GUI tests for newer Tk and display scaling (GH-153742) In test_sidebar.test_mousewheel, only use the X11 <Button-4>/<Button-5> events when testing on x11 Tk before 8.7. Otherwise, use <Mousewheel> as on other systems. In test_configdialog, assert the 'disabled' state flag alone instead of the exact ttk state tuple (which transient pointer states break), and restore the tests' method masks with addCleanup(). (cherry picked from commit a2581eb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
terryjreedy
pushed a commit
that referenced
this pull request
Jul 22, 2026
…ing (GH-153742) (#154405) gh-153741: Harden IDLE GUI tests for newer Tk and display scaling (GH-153742) In test_sidebar.test_mousewheel, only use the X11 <Button-4>/<Button-5> events when testing on x11 Tk before 8.7. Otherwise, use <Mousewheel> as on other systems. In test_configdialog, assert the 'disabled' state flag alone instead of the exact ttk state tuple (which transient pointer states break), and restore the tests' method masks with addCleanup(). (cherry picked from commit a2581eb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several IDLE GUI tests fail on newer Tk or are fragile under display scaling. All test-only.
test_sidebartest_mousewheelfails on Tk 8.7+, which replaced the X11<Button-4>/<Button-5>wheel events with<MouseWheel>; the test now sends the button events only on Tk before 8.7. Verified on Tk 8.5.19, 8.6.17, 8.7b1, 9.0.3 and 9.1b1.test_configdialogcompared ttk widget states with exact tuples, which break when a widget picks up transientactive/hoverstates from the pointer (whose position shifts with the display scaling). The tested methods only toggledisabled, so the tests now assert that flag alone.Several
test_configdialogtests re-mask a method at the end, which is skipped on a mid-test failure (leaving the real method in place for the rest of the class);addCleanup()now makes the restore unconditional.🤖 Generated with Claude Code