Skip to content

Commit dbbe4d2

Browse files
bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938)
1 parent 81b425d commit dbbe4d2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Lib/tkinter/test/test_tkinter/test_widgets.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ def test_configure_activestyle(self):
800800
self.checkEnumParam(widget, 'activestyle',
801801
'dotbox', 'none', 'underline')
802802

803-
test_justify = requires_tcl(8, 6, 5)(StandardOptionsTests.test_configure_justify)
803+
test_configure_justify = requires_tcl(8, 6, 5)(StandardOptionsTests.test_configure_justify)
804804

805805
def test_configure_listvariable(self):
806806
widget = self.create()
@@ -939,7 +939,7 @@ def test_configure_digits(self):
939939

940940
def test_configure_from(self):
941941
widget = self.create()
942-
conv = False if get_tk_patchlevel() >= (8, 6, 10) else float_round
942+
conv = float if get_tk_patchlevel() >= (8, 6, 10) else float_round
943943
self.checkFloatParam(widget, 'from', 100, 14.9, 15.1, conv=conv)
944944

945945
def test_configure_label(self):

Lib/tkinter/test/test_ttk/test_style.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from tkinter import ttk
55
from test import support
66
from test.support import requires
7-
from tkinter.test.support import AbstractTkTest
7+
from tkinter.test.support import AbstractTkTest, get_tk_patchlevel
88

99
requires('gui')
1010

@@ -170,6 +170,8 @@ def test_map_custom_copy(self):
170170
newname = f'C.{name}'
171171
self.assertEqual(style.map(newname), {})
172172
style.map(newname, **default)
173+
if theme == 'alt' and name == '.' and get_tk_patchlevel() < (8, 6, 1):
174+
default['embossed'] = [('disabled', '1')]
173175
self.assertEqual(style.map(newname), default)
174176
for key, value in default.items():
175177
self.assertEqual(style.map(newname, key), value)

0 commit comments

Comments
 (0)