cpython/Lib/test/test_tkinter
Miss Islington (bot) 8777a0cf02
[3.15] gh-78335: Complete the widget option lists in tkinter docstrings (GH-152485) (GH-152500)
Several widget __init__ docstrings omitted valid options, and Menubutton and
Message had no option list at all.  List every option supported by the widget,
tagging those added in Tk 9.0 and 9.1.

Add test_options_in_docstring, asserting that every option in OPTIONS is named
in the widget's __init__ docstring.  Options reported by keys() but not in the
docstring are only printed in verbose mode, as some depend on the Tk version.
(cherry picked from commit ba0c0e6be1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 19:53:52 +03:00
..
__init__.py gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) 2026-01-16 18:38:38 +02:00
__main__.py
README
support.py gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) 2026-01-16 18:38:38 +02:00
test_colorchooser.py gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) 2026-01-16 18:38:38 +02:00
test_dnd.py [3.15] gh-151678: Add more tests for tkinter.dnd (GH-152362) (GH-152367) 2026-06-27 07:41:21 +00:00
test_filedialog.py [3.15] gh-151678: Add tests for tkinter.filedialog (GH-151781) (GH-151795) 2026-06-20 13:49:16 +00:00
test_font.py [3.15] gh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751) (GH-151754) 2026-06-19 23:12:25 +00:00
test_geometry_managers.py [3.15] gh-78335: Complete the widget option lists in tkinter docstrings (GH-152485) (GH-152500) 2026-06-28 19:53:52 +03:00
test_images.py [3.15] gh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751) (GH-151754) 2026-06-19 23:12:25 +00:00
test_loadtk.py gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) 2026-01-16 18:38:38 +02:00
test_messagebox.py gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570) 2026-01-16 18:38:38 +02:00
test_misc.py [3.15] gh-38464: Make tkinter nametowidget() work with cloned menus (GH-152336) (GH-152349) 2026-06-26 23:31:46 +00:00
test_scrolledtext.py [3.15] gh-151678: Add tests for tkinter.scrolledtext (GH-151753) (GH-151759) 2026-06-20 09:17:52 +03:00
test_simpledialog.py [3.15] gh-151678: Add tests for tkinter.simpledialog (GH-151856) (GH-151869) 2026-06-21 18:59:26 +00:00
test_text.py [3.15] gh-151678: Add tests for the remaining tkinter Misc, Wm and Text methods (GH-151782) (GH-151799) 2026-06-20 14:12:08 +00:00
test_variables.py [3.15] gh-151678: Add tests for tkinter font, image, variable, Misc and Wm methods (GH-151751) (GH-151754) 2026-06-19 23:12:25 +00:00
test_widgets.py [3.15] gh-151678: Add tests for tkinter widget virtual events (GH-151793) (GH-151805) 2026-06-20 15:00:38 +00:00
widget_tests.py [3.15] gh-78335: Complete the widget option lists in tkinter docstrings (GH-152485) (GH-152500) 2026-06-28 19:53:52 +03:00

Writing new tests
=================

Precaution
----------

    New tests should always use only one Tk window at once, like all the
    current tests do. This means that you have to destroy the current window
    before creating another one, and clean up after the test. The motivation
    behind this is that some tests may depend on having its window focused
    while it is running to work properly, and it may be hard to force focus
    on your window across platforms (right now only test_traversal at
    test_ttk.test_widgets.NotebookTest depends on this).