summaryrefslogtreecommitdiff
path: root/Lib/tkinter/test/support.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-07-22 22:14:45 +0300
committerGitHub <noreply@github.com>2018-07-22 22:14:45 +0300
commit0ff174643437f34c50c8625462b5419b1a643b57 (patch)
tree786a68004a94714d1934af909693c4e6ec6d4ab5 /Lib/tkinter/test/support.py
parent9c136700aa1f755fa2ea64594688a0930b716597 (diff)
downloadcpython-git-0ff174643437f34c50c8625462b5419b1a643b57.tar.gz
[3.6] bpo-34189: Add simple tests for new Tk widget options. (GH-8396) (GH-8399)
(cherry picked from commit e271ca78e37a502b3dc1036f824aa3999efcd56b) (cherry picked from commit c75c1e0e8aeb720ac3fcfab119b70cabba4e8235)
Diffstat (limited to 'Lib/tkinter/test/support.py')
-rw-r--r--Lib/tkinter/test/support.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/tkinter/test/support.py b/Lib/tkinter/test/support.py
index dd155fad0f..0d9a65a5cc 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