gh-153741: Harden IDLE GUI tests for newer Tk and display scaling#153742
Open
serhiy-storchaka wants to merge 1 commit into
Open
gh-153741: Harden IDLE GUI tests for newer Tk and display scaling#153742serhiy-storchaka wants to merge 1 commit into
serhiy-storchaka wants to merge 1 commit into
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>
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