summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test/test_ttk/test_widgets.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-10-20 13:50:31 (GMT)
committerGitHub <noreply@github.com>2021-10-20 13:50:31 (GMT)
commit15cd7a7f9edcc121f273ae1d8007128282f8f85f (patch)
tree614dc6675234a380b998ef08ed2467d62ac83810 /Lib/tkinter/test/test_ttk/test_widgets.py
parentd46b2217d13bbcf8145da8c12a487ba775d6f162 (diff)
downloadcpython-15cd7a7f9edcc121f273ae1d8007128282f8f85f.zip
cpython-15cd7a7f9edcc121f273ae1d8007128282f8f85f.tar.gz
cpython-15cd7a7f9edcc121f273ae1d8007128282f8f85f.tar.bz2
bpo-45436: Fix tkinter tests with Tcl/Tk 8.6.11+ (GH-29077) (GH-29081)
Since v8.6.11, a few configuration options seem to accept an empty value where they did not previously; particularly the `type` of a `Menu` widget, and the `compound` of any ttk widget with a label. Providing an explicit expected error message to `checkEnumParam` bypasses the check of an empty value, which no longer raises `TclError`. (cherry picked from commit 4fe454c6f54b0948af67b53af6c2f35af6377e69) Co-authored-by: Zachary Ware <zach@python.org>
Diffstat (limited to 'Lib/tkinter/test/test_ttk/test_widgets.py')
-rw-r--r--Lib/tkinter/test/test_ttk/test_widgets.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py
index a2a4de2..904aed0 100644
--- a/Lib/tkinter/test/test_ttk/test_widgets.py
+++ b/Lib/tkinter/test/test_ttk/test_widgets.py
@@ -169,10 +169,13 @@ class AbstractLabelTest(AbstractWidgetTest):
errmsg='image "spam" doesn\'t exist')
def test_configure_compound(self):
+ options = 'none text image center top bottom left right'.split()
+ errmsg = (
+ 'bad compound "{}": must be'
+ f' {", ".join(options[:-1])}, or {options[-1]}'
+ )
widget = self.create()
- self.checkEnumParam(widget, 'compound',
- 'none', 'text', 'image', 'center',
- 'top', 'bottom', 'left', 'right')
+ self.checkEnumParam(widget, 'compound', *options, errmsg=errmsg)
def test_configure_state(self):
widget = self.create()