Skip to content

gh-151678: Add tests for tkinter widget virtual events - #151793

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:test-tkinter-virtual-events
Jun 20, 2026
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:test-tkinter-virtual-events

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Verify the virtual events that widgets emit in response to user interaction, driven by generated events: <<ListboxSelect>> (Listbox), <<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>, <<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).

Verify the virtual events that widgets emit in response to user
interaction, driven by generated events: <<ListboxSelect>> (Listbox),
<<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>,
<<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting core review labels Jun 20, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes skip news labels Jun 20, 2026
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) June 20, 2026 13:19
@serhiy-storchaka
serhiy-storchaka merged commit e51b616 into python:main Jun 20, 2026
99 of 101 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 20, 2026

Copy link
Copy Markdown

GH-151805 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 20, 2026
@bedevere-app

bedevere-app Bot commented Jun 20, 2026

Copy link
Copy Markdown

GH-151806 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 20, 2026
@bedevere-app

bedevere-app Bot commented Jun 20, 2026

Copy link
Copy Markdown

GH-151807 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 20, 2026
serhiy-storchaka added a commit that referenced this pull request Jun 20, 2026
) (GH-151807)

Verify the virtual events that widgets emit in response to user
interaction, driven by generated events: <<ListboxSelect>> (Listbox),
<<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>,
<<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).
(cherry picked from commit e51b616)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jun 20, 2026
) (GH-151806)

Verify the virtual events that widgets emit in response to user
interaction, driven by generated events: <<ListboxSelect>> (Listbox),
<<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>,
<<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).
(cherry picked from commit e51b616)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jun 20, 2026
) (GH-151805)

Verify the virtual events that widgets emit in response to user
interaction, driven by generated events: <<ListboxSelect>> (Listbox),
<<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>,
<<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).
(cherry picked from commit e51b616)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@StanFromIreland

Copy link
Copy Markdown
Member

@serhiy-storchaka the test_virtual_events fails on 3.13 branch, see run:

======================================================================
FAIL: test_virtual_events (test.test_ttk.test_widgets.TreeviewTest.test_virtual_events)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_ttk\test_widgets.py", line 1966, in test_virtual_events
    self.assertEqual(self.tv.selection(), (item2,))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: ('I001',) != ('I003',)

@serhiy-storchaka
serhiy-storchaka deleted the test-tkinter-virtual-events branch June 29, 2026 13:56
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

This is a flaky test. #152499 hardened many of such tests, but missed this one (because it does not depends on geometry directly). Should be fixed by #152599.

pyctrl pushed a commit to pyctrl/cpython that referenced this pull request Jul 5, 2026
…H-151793)

Verify the virtual events that widgets emit in response to user
interaction, driven by generated events: <<ListboxSelect>> (Listbox),
<<Increment>> and <<Decrement>> (ttk Spinbox), and <<TreeviewSelect>>,
<<TreeviewOpen>> and <<TreeviewClose>> (ttk Treeview).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants