Skip to content

[3.10] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) #130274

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 3 commits into from
Feb 19, 2025
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jobs:
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v3.0.2
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
Expand Down
14 changes: 10 additions & 4 deletions Lib/tkinter/test/test_tkinter/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,9 @@ def test_configure_tabs(self):
else:
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'))
expected=(10.2, 20.7, '1i', '2i')
if get_tk_patchlevel() >= (8, 6, 14)
else ('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',
Expand Down Expand Up @@ -1014,12 +1016,16 @@ def test_itemconfigure(self):
widget.itemconfigure()
with self.assertRaisesRegex(TclError, 'bad listbox index "red"'):
widget.itemconfigure('red')
if get_tk_patchlevel() >= (8, 6, 14):
prefix = ('background', '', '', '')
else:
prefix = ('background', 'background', 'Background', '')
self.assertEqual(widget.itemconfigure(0, 'background'),
('background', 'background', 'Background', '', 'red'))
(*prefix, 'red'))
self.assertEqual(widget.itemconfigure('end', 'background'),
('background', 'background', 'Background', '', 'violet'))
(*prefix, 'violet'))
self.assertEqual(widget.itemconfigure('@0,0', 'background'),
('background', 'background', 'Background', '', 'red'))
(*prefix, 'red'))

d = widget.itemconfigure(0)
self.assertIsInstance(d, dict)
Expand Down
17 changes: 12 additions & 5 deletions Lib/tkinter/test/test_ttk/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ def test_configure_class(self):

def test_configure_padding(self):
widget = self.create()
self.checkParam(widget, 'padding', 0, expected=('0',))
self.checkParam(widget, 'padding', 5, expected=('5',))
self.checkParam(widget, 'padding', (5, 6), expected=('5', '6'))
if get_tk_patchlevel() < (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', (5, 6),
expected=(5, 6), conv=padding_conv)
self.checkParam(widget, 'padding', (5, 6, 7),
expected=('5', '6', '7'))
expected=(5, 6, 7), conv=padding_conv)
self.checkParam(widget, 'padding', (5, 6, 7, 8),
expected=('5', '6', '7', '8'))
expected=(5, 6, 7, 8), conv=padding_conv)
self.checkParam(widget, 'padding', ('5p', '6p', '7p', '8p'))
self.checkParam(widget, 'padding', (), expected='')

Expand Down
Loading