gh-104496: Use correct Tcl or Tk version in Tkinter tests (GH-107688)

In future Tcl and Tk versions can be desynchronized.
This commit is contained in:
Serhiy Storchaka 2023-08-07 14:11:39 +03:00 committed by GitHub
parent 6925c578a0
commit 3c8e8f3cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 39 deletions

View file

@ -1,7 +1,7 @@
# Common tests for test_tkinter/test_widgets.py and test_ttk/test_widgets.py
import tkinter
from test.test_tkinter.support import (AbstractTkTest, tcl_version,
from test.test_tkinter.support import (AbstractTkTest, tk_version,
pixels_conv, tcl_obj_eq)
import test.support
@ -22,7 +22,7 @@ class AbstractWidgetTest(AbstractTkTest):
return self._scaling
def _str(self, value):
if not self._stringify and self.wantobjects and tcl_version >= (8, 6):
if not self._stringify and self.wantobjects and tk_version >= (8, 6):
return value
if isinstance(value, tuple):
return ' '.join(map(self._str, value))
@ -156,7 +156,7 @@ class AbstractWidgetTest(AbstractTkTest):
'flat', 'groove', 'raised', 'ridge', 'solid', 'sunken')
errmsg='bad relief "spam": must be '\
'flat, groove, raised, ridge, solid, or sunken'
if tcl_version < (8, 6):
if tk_version < (8, 6):
errmsg = None
self.checkInvalidParam(widget, name, 'spam',
errmsg=errmsg)