]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (#130275)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 Feb 2025 08:53:20 +0000 (09:53 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Feb 2025 08:53:20 +0000 (10:53 +0200)
Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
.github/workflows/build.yml
Lib/tkinter/test/test_tkinter/test_widgets.py
Lib/tkinter/test/test_ttk/test_widgets.py

index ae099ee1dced6e76b9f9b8e8f8626784b1c14ab3..09f38e9b250cbb234d5f0e3fc2fac7b5ba53c58b 100644 (file)
@@ -200,7 +200,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 }}
@@ -246,7 +246,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 }}
index c0b92bf3b1921b0373debc93ebe4abd8666bebb8..4f21e046a33e013c443d4172f9a9ecb03954adb2 100644 (file)
@@ -650,7 +650,9 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
         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',
@@ -830,12 +832,16 @@ class ListboxTest(AbstractWidgetTest, unittest.TestCase):
             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)
index 1cb7e74c66ec748f3eb5f965ae947e3c902b3bc5..48e2eb59b4b7843326e2fed1411687f78adefbe1 100644 (file)
@@ -28,13 +28,20 @@ class StandardTtkOptionsTests(StandardOptionsTests):
 
     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='')