]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-128846: Fix test_configure_custom_copy for the aqua theme with Tk 9 (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 15 Jul 2026 14:53:13 +0000 (17:53 +0300)
committerGitHub <noreply@github.com>
Wed, 15 Jul 2026 14:53:13 +0000 (14:53 +0000)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_ttk/test_style.py

index 56d8a5931fdfa5ce1bdbb6075958c5cd2faa875c..41f3c2a9b94ed444e79e320524fa9867e8a263b0 100644 (file)
@@ -161,9 +161,16 @@ class StyleTest(AbstractTkTest, unittest.TestCase):
                     newname = f'C.{name}'
                     self.assertEqual(style.configure(newname), None)
                     style.configure(newname, **default)
-                    self.assertEqual(style.configure(newname), default)
+                    # gh-128846: the aqua theme with Tk 9 reports an unset
+                    # option as an empty tuple, while the copy reports it as an
+                    # empty string.
+                    def norm(value):
+                        return '' if value == () else value
+                    self.assertEqual(style.configure(newname),
+                                     {k: norm(v) for k, v in default.items()})
                     for key, value in default.items():
-                        self.assertEqual(style.configure(newname, key), value)
+                        self.assertEqual(style.configure(newname, key),
+                                         norm(value))
 
 
     def test_map_custom_copy(self):