Skip to content

bpo-45979: Fix Tkinter tests with old Tk #31938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/tkinter/test/test_tkinter/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def test_configure_activestyle(self):
self.checkEnumParam(widget, 'activestyle',
'dotbox', 'none', 'underline')

test_justify = requires_tcl(8, 6, 5)(StandardOptionsTests.test_configure_justify)
test_configure_justify = requires_tcl(8, 6, 5)(StandardOptionsTests.test_configure_justify)

def test_configure_listvariable(self):
widget = self.create()
Expand Down Expand Up @@ -939,7 +939,7 @@ def test_configure_digits(self):

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

def test_configure_label(self):
Expand Down
4 changes: 3 additions & 1 deletion Lib/tkinter/test/test_ttk/test_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from tkinter import ttk
from test import support
from test.support import requires
from tkinter.test.support import AbstractTkTest
from tkinter.test.support import AbstractTkTest, get_tk_patchlevel

requires('gui')

Expand Down Expand Up @@ -170,6 +170,8 @@ def test_map_custom_copy(self):
newname = f'C.{name}'
self.assertEqual(style.map(newname), {})
style.map(newname, **default)
if theme == 'alt' and name == '.' and get_tk_patchlevel() < (8, 6, 1):
default['embossed'] = [('disabled', '1')]
self.assertEqual(style.map(newname), default)
for key, value in default.items():
self.assertEqual(style.map(newname, key), value)
Expand Down