Skip to content

Improve test coverage of tkinter #151678

@serhiy-storchaka

Description

@serhiy-storchaka

Feature or enhancement

Large parts of the :mod:tkinter public API have little or no direct test coverage. Widget configuration options are tested fairly thoroughly via the AbstractWidgetTest framework in Lib/test/test_tkinter/test_widgets.py, but many widget methods and the per-element configuration surfaces (tags, embedded images and windows, marks, etc.) are not exercised at all.

For example, before this issue test_text.py tested only a handful of Text methods (debug, search, search_all, count), leaving indices, content manipulation, marks, tags, undo/redo, dump, embedded images and windows, peers, geometry and the tag/image/window configuration options untested.

The goal is to incrementally add tests for the untested tkinter API, widget by widget and method by method:

  • Text — methods and tag/image/window option configuration (in progress).
  • Canvas — items, tags, coords, scanning, postscript, and item options.
  • Listbox, Entry, Spinbox, Menu — selection, indices, item options.
  • Misc/Wm — window manager, clipboard, selection, grab, event and winfo methods.
  • Geometry managers (pack/place/grid) query methods.
  • ttk widgets, Style, Treeview.

This complements the related audit of Tk commands that are only partially wrapped by tkinter.

Links to previous discussion

Related to the recent tkinter documentation overhaul (gh-86726).

Linked PRs

Metadata

Metadata

Labels

3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixestestsTests in the Lib/test dirtopic-tkinter
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions