mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +00:00
[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>
This commit is contained in:
parent
4dc27bc0b7
commit
4fabbf9773
6 changed files with 250 additions and 137 deletions
|
@ -6,7 +6,7 @@ import tkinter
|
|||
from tkinter import (Variable, StringVar, IntVar, DoubleVar, BooleanVar, Tcl,
|
||||
TclError)
|
||||
from test.support import ALWAYS_EQ
|
||||
from test.test_tkinter.support import AbstractDefaultRootTest
|
||||
from test.test_tkinter.support import AbstractDefaultRootTest, tcl_version
|
||||
|
||||
|
||||
class Var(Variable):
|
||||
|
@ -112,6 +112,8 @@ class TestVariable(TestBase):
|
|||
self.assertTrue(v.side_effect)
|
||||
|
||||
def test_trace_old(self):
|
||||
if tcl_version >= (9, 0):
|
||||
self.skipTest('requires Tcl version < 9.0')
|
||||
# Old interface
|
||||
v = Variable(self.root)
|
||||
vname = str(v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue