cpython/Lib/test/test_tkinter
Miss Islington (bot) 4fabbf9773
[3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864)
The tests are now passed with the current version of Tcl/Tk under
development (8.7b1+ and 9.0b3+).

The following changes were also made to make the tests more flexible:

* Helper methods like checkParam() now interpret the expected error message
  as a regular expression instead of a literal.
* Add support of new arguments in checkEnumParam():
  - allow_empty=True skips testing with empty string;
  - fullname= specifies the name for error message if it differs from the
    option name;
  - sort=True sorts values for error message.
* Add support of the allow_empty argument in checkReliefParam():
  allow_empty=True adds an empty string to the list of accepted values.
* Attributes _clip_highlightthickness, _clip_pad and  _clip_borderwidth
  specify how negative values of options -highlightthickness, -padx, -pady
  and -borderwidth are handled.
* Use global variables for some common error messages.

(cherry picked from commit 6ad26de6e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-22 07:17:55 +00:00
..
__init__.py
__main__.py
README
support.py
test_colorchooser.py
test_font.py
test_geometry_managers.py [3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864) 2024-06-22 07:17:55 +00:00
test_images.py [3.13] gh-119791: Fix new Tkinter tests for wantobjects=0 (GH-119792) (GH-119794) 2024-05-30 19:16:57 +00:00
test_loadtk.py
test_messagebox.py
test_misc.py [3.13] Add Tkinter tests for different events (GH-118778) (GH-119091) 2024-05-16 13:17:19 +03:00
test_simpledialog.py
test_text.py gh-97928: Partially restore the behavior of tkinter.Text.count() by default (GH-115031) 2024-02-11 12:43:14 +02:00
test_variables.py [3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864) 2024-06-22 07:17:55 +00:00
test_widgets.py [3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864) 2024-06-22 07:17:55 +00:00
widget_tests.py [3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864) 2024-06-22 07:17:55 +00: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).