Skip to content

gh-153741: Harden IDLE GUI tests for newer Tk and display scaling#153742

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:idle-gui-tests-newer-tk
Open

gh-153741: Harden IDLE GUI tests for newer Tk and display scaling#153742
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:idle-gui-tests-newer-tk

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 15, 2026

Copy link
Copy Markdown
Member

Several IDLE GUI tests fail on newer Tk or are fragile under display scaling. All test-only.

test_sidebar test_mousewheel fails 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_configdialog compared ttk widget states with exact tuples, which break when a widget picks up transient active/hover states from the pointer (whose position shifts with the display scaling). The tested methods only toggle disabled, so the tests now assert that flag alone.

Several test_configdialog tests 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

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>
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 15, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant