Skip to content

Commit 832bc0b

Browse files
gh-153513: Remove obsolete Tk version guards in tkinter tests (GH-153615)
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>
1 parent dd2faeb commit 832bc0b

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

Lib/test/test_tkinter/test_widgets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -915,9 +915,7 @@ def test_configure_tabs(self):
915915
widget = self.create()
916916
self.checkParam(widget, 'tabs', (10.2, 20.7, '1i', '2i'))
917917
self.checkParam(widget, 'tabs', '10.2 20.7 1i 2i',
918-
expected=(10.2, 20.7, '1i', '2i')
919-
if get_tk_patchlevel(self.root) >= (8, 6, 14)
920-
else ('10.2', '20.7', '1i', '2i'))
918+
expected=(10.2, 20.7, '1i', '2i'))
921919
self.checkParam(widget, 'tabs', '2c left 4c 6c center',
922920
expected=('2c', 'left', '4c', '6c', 'center'))
923921
self.checkInvalidParam(widget, 'tabs', 'spam',

Lib/test/test_ttk/test_widgets.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,14 @@ def test_configure_class(self):
2929

3030
def test_configure_padding(self):
3131
widget = self.create()
32-
if get_tk_patchlevel(self.root) < (8, 6, 14):
33-
def padding_conv(value):
34-
self.assertIsInstance(value, tuple)
35-
return tuple(map(str, value))
36-
else:
37-
padding_conv = None
38-
self.checkParam(widget, 'padding', 0, expected=(0,), conv=padding_conv)
39-
self.checkParam(widget, 'padding', 5, expected=(5,), conv=padding_conv)
32+
self.checkParam(widget, 'padding', 0, expected=(0,))
33+
self.checkParam(widget, 'padding', 5, expected=(5,))
4034
self.checkParam(widget, 'padding', (5, 6),
41-
expected=(5, 6), conv=padding_conv)
35+
expected=(5, 6))
4236
self.checkParam(widget, 'padding', (5, 6, 7),
43-
expected=(5, 6, 7), conv=padding_conv)
37+
expected=(5, 6, 7))
4438
self.checkParam(widget, 'padding', (5, 6, 7, 8),
45-
expected=(5, 6, 7, 8), conv=padding_conv)
39+
expected=(5, 6, 7, 8))
4640
self.checkParam(widget, 'padding', ('5p', '6p', '7p', '8p'))
4741
self.checkParam(widget, 'padding', (), expected='')
4842

0 commit comments

Comments
 (0)