]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124545)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 26 Sep 2024 16:20:09 +0000 (18:20 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Sep 2024 16:20:09 +0000 (11:20 -0500)
(cherry picked from commit fb6bd31cb74d2f7e7b525ee4fe9f45475fc94ce9)

Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Marc Culler <culler@users.noreply.github.com>
Lib/test/test_ttk/test_widgets.py
Misc/NEWS.d/next/Tests/2024-09-25-12-39-34.gh-issue-124378.Ywwgia.rst [new file with mode: 0644]

index eee3916205400948c039baf7ea3fed7ebee1ec9b..3e541fbc5a4dedb549453010cb5da77bace3c5f7 100644 (file)
@@ -963,8 +963,7 @@ class ScrollbarTest(AbstractWidgetTest, unittest.TestCase):
         return ttk.Scrollbar(self.root, **kwargs)
 
 
-@add_standard_options(PixelSizeTests if tk_version >= (8, 7) else IntegerSizeTests,
-                      StandardTtkOptionsTests)
+@add_standard_options(StandardTtkOptionsTests)
 class NotebookTest(AbstractWidgetTest, unittest.TestCase):
     OPTIONS = (
         'class', 'cursor', 'height', 'padding', 'style', 'takefocus', 'width',
@@ -983,6 +982,20 @@ class NotebookTest(AbstractWidgetTest, unittest.TestCase):
     def create(self, **kwargs):
         return ttk.Notebook(self.root, **kwargs)
 
+    def test_configure_height(self):
+        widget = self.create()
+        if get_tk_patchlevel(self.root) < (8, 6, 15):
+            self.checkIntegerParam(widget, 'height', 402, -402, 0)
+        else:
+            self.checkPixelsParam(widget, 'height', '10c', 402, -402, 0, conv=False)
+
+    def test_configure_width(self):
+        widget = self.create()
+        if get_tk_patchlevel(self.root) < (8, 6, 15):
+            self.checkIntegerParam(widget, 'width', 402, -402, 0)
+        else:
+            self.checkPixelsParam(widget, 'width', '10c', 402, -402, 0, conv=False)
+
     def test_tab_identifiers(self):
         self.nb.forget(0)
         self.nb.hide(self.child2)
diff --git a/Misc/NEWS.d/next/Tests/2024-09-25-12-39-34.gh-issue-124378.Ywwgia.rst b/Misc/NEWS.d/next/Tests/2024-09-25-12-39-34.gh-issue-124378.Ywwgia.rst
new file mode 100644 (file)
index 0000000..9ddcca0
--- /dev/null
@@ -0,0 +1 @@
+Updated ``test_ttk`` to pass with Tcl/Tk 8.6.15.