]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-153513: Remove obsolete Tk version guards in tkinter tests (GH-153615)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 12 Jul 2026 15:27:10 +0000 (18:27 +0300)
committerGitHub <noreply@github.com>
Sun, 12 Jul 2026 15:27:10 +0000 (18:27 +0300)
Since gh-153513, _tkinter returns int, float and pixel objects for the
corresponding Tcl object types on all Tk versions.  The tests for the
Text "tabs" and ttk "padding" options therefore no longer need to expect
string tuples on Tk older than 8.6.14.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_tkinter/test_widgets.py
Lib/test/test_ttk/test_widgets.py

index 98c78895e8493295587a85a3473b09d152da2656..f6f9332cb105e5950cdb871265ccfe27e0815175 100644 (file)
@@ -915,9 +915,7 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
         widget = self.create()
         self.checkParam(widget, 'tabs', (10.2, 20.7, '1i', '2i'))
         self.checkParam(widget, 'tabs', '10.2 20.7 1i 2i',
-                        expected=(10.2, 20.7, '1i', '2i')
-                                 if get_tk_patchlevel(self.root) >= (8, 6, 14)
-                                 else ('10.2', '20.7', '1i', '2i'))
+                        expected=(10.2, 20.7, '1i', '2i'))
         self.checkParam(widget, 'tabs', '2c left 4c 6c center',
                         expected=('2c', 'left', '4c', '6c', 'center'))
         self.checkInvalidParam(widget, 'tabs', 'spam',
index 36b8658656076d8bb89c5e161c9d9818de27d6c0..dc23c52a884465727cb605ec2dbda94e29d36875 100644 (file)
@@ -29,20 +29,14 @@ class StandardTtkOptionsTests(StandardOptionsTests):
 
     def test_configure_padding(self):
         widget = self.create()
-        if get_tk_patchlevel(self.root) < (8, 6, 14):
-            def padding_conv(value):
-                self.assertIsInstance(value, tuple)
-                return tuple(map(str, value))
-        else:
-            padding_conv = None
-        self.checkParam(widget, 'padding', 0, expected=(0,), conv=padding_conv)
-        self.checkParam(widget, 'padding', 5, expected=(5,), conv=padding_conv)
+        self.checkParam(widget, 'padding', 0, expected=(0,))
+        self.checkParam(widget, 'padding', 5, expected=(5,))
         self.checkParam(widget, 'padding', (5, 6),
-                        expected=(5, 6), conv=padding_conv)
+                        expected=(5, 6))
         self.checkParam(widget, 'padding', (5, 6, 7),
-                        expected=(5, 6, 7), conv=padding_conv)
+                        expected=(5, 6, 7))
         self.checkParam(widget, 'padding', (5, 6, 7, 8),
-                        expected=(5, 6, 7, 8), conv=padding_conv)
+                        expected=(5, 6, 7, 8))
         self.checkParam(widget, 'padding', ('5p', '6p', '7p', '8p'))
         self.checkParam(widget, 'padding', (), expected='')