summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test/widget_tests.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-04-13 16:52:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-04-13 16:52:23 (GMT)
commite544f9a27eec202d4a959dd2a255d8ce05aee663 (patch)
tree157e1944906e2f89c1c206358a62832a5f4b1cf1 /Lib/tkinter/test/widget_tests.py
parenta39938ff44ae9e63ae04b9b2856921a44bdf2b2c (diff)
downloadcpython-e544f9a27eec202d4a959dd2a255d8ce05aee663.zip
cpython-e544f9a27eec202d4a959dd2a255d8ce05aee663.tar.gz
cpython-e544f9a27eec202d4a959dd2a255d8ce05aee663.tar.bz2
Issue #20635: Added tests for Tk geometry managers.
Diffstat (limited to 'Lib/tkinter/test/widget_tests.py')
-rw-r--r--Lib/tkinter/test/widget_tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/tkinter/test/widget_tests.py b/Lib/tkinter/test/widget_tests.py
index a9820a7..d983acc 100644
--- a/Lib/tkinter/test/widget_tests.py
+++ b/Lib/tkinter/test/widget_tests.py
@@ -33,6 +33,17 @@ class AbstractWidgetTest:
if not self.root.wantobjects():
self.wantobjects = False
+ def tearDown(self):
+ for w in self.root.winfo_children():
+ w.destroy()
+
+ def _str(self, value):
+ if self.wantobjects and tcl_version >= (8, 6):
+ return value
+ if isinstance(value, tuple):
+ return ' '.join(map(self._str, value))
+ return str(value)
+
def create(self, **kwargs):
widget = self._create(**kwargs)
self.addCleanup(widget.destroy)