diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-03-18 12:44:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 12:44:54 (GMT) |
commit | d27af88c1bcf3c6c185f81218b7bf86b38128ea9 (patch) | |
tree | 331e5fa7be3cc03e9693b8dd425f82b3dd7cbbf9 /Lib/tkinter/test | |
parent | 0b5f99ad1af0892a2d6043abd8aeb10d685d3844 (diff) | |
download | cpython-d27af88c1bcf3c6c185f81218b7bf86b38128ea9.zip cpython-d27af88c1bcf3c6c185f81218b7bf86b38128ea9.tar.gz cpython-d27af88c1bcf3c6c185f81218b7bf86b38128ea9.tar.bz2 |
bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938)
(cherry picked from commit dbbe4d2d0075fa0e95b069fb4780d79aae3514c7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/tkinter/test')
-rw-r--r-- | Lib/tkinter/test/test_tkinter/test_widgets.py | 4 | ||||
-rw-r--r-- | Lib/tkinter/test/test_ttk/test_style.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index cc227e5..c0b92bf 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -800,7 +800,7 @@ class ListboxTest(AbstractWidgetTest, unittest.TestCase): 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() @@ -939,7 +939,7 @@ class ScaleTest(AbstractWidgetTest, unittest.TestCase): 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): diff --git a/Lib/tkinter/test/test_ttk/test_style.py b/Lib/tkinter/test/test_ttk/test_style.py index a33c24a..54ad343 100644 --- a/Lib/tkinter/test/test_ttk/test_style.py +++ b/Lib/tkinter/test/test_ttk/test_style.py @@ -4,7 +4,7 @@ import tkinter 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') @@ -170,6 +170,8 @@ class StyleTest(AbstractTkTest, unittest.TestCase): 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) |