diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-07-22 18:41:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 18:41:48 (GMT) |
commit | c75c1e0e8aeb720ac3fcfab119b70cabba4e8235 (patch) | |
tree | 9a9a16f915ae27b72a14fb45e2fe6d156d20ae9d /Lib | |
parent | e271ca78e37a502b3dc1036f824aa3999efcd56b (diff) | |
download | cpython-c75c1e0e8aeb720ac3fcfab119b70cabba4e8235.zip cpython-c75c1e0e8aeb720ac3fcfab119b70cabba4e8235.tar.gz cpython-c75c1e0e8aeb720ac3fcfab119b70cabba4e8235.tar.bz2 |
bpo-34189: Fix checking for bugfix Tcl version. (GH-8397)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/tkinter/test/support.py | 14 | ||||
-rw-r--r-- | Lib/tkinter/test/test_tkinter/test_widgets.py | 4 |
2 files changed, 14 insertions, 4 deletions
diff --git a/Lib/tkinter/test/support.py b/Lib/tkinter/test/support.py index dd155fa..0d9a65a 100644 --- a/Lib/tkinter/test/support.py +++ b/Lib/tkinter/test/support.py @@ -1,3 +1,4 @@ +import functools import re import tkinter import unittest @@ -54,9 +55,20 @@ import _tkinter tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split('.'))) def requires_tcl(*version): - return unittest.skipUnless(tcl_version >= version, + if len(version) <= 2: + return unittest.skipUnless(tcl_version >= version, 'requires Tcl version >= ' + '.'.join(map(str, version))) + def deco(test): + @functools.wraps(test) + def newtest(self): + if get_tk_patchlevel() < (8, 6, 5): + self.skipTest('requires Tcl version >= ' + + '.'.join(map(str, get_tk_patchlevel()))) + test(self) + return newtest + return deco + _tk_patchlevel = None def get_tk_patchlevel(): global _tk_patchlevel diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index cd2a380..e4c9d33 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -717,9 +717,7 @@ class ListboxTest(AbstractWidgetTest, unittest.TestCase): self.checkEnumParam(widget, 'activestyle', 'dotbox', 'none', 'underline') - @requires_tcl(8, 6, 5) - def test_justify(self): - AbstractWidgetTest.test_justify(self) + test_justify = requires_tcl(8, 6, 5)(StandardOptionsTests.test_justify) def test_listvariable(self): widget = self.create() |