mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bpo-34189: Fix checking for bugfix Tcl version. (GH-8397)
This commit is contained in:
parent
e271ca78e3
commit
c75c1e0e8a
2 changed files with 14 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import functools
|
||||||
import re
|
import re
|
||||||
import tkinter
|
import tkinter
|
||||||
import unittest
|
import unittest
|
||||||
|
@ -54,9 +55,20 @@ import _tkinter
|
||||||
tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split('.')))
|
tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split('.')))
|
||||||
|
|
||||||
def requires_tcl(*version):
|
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)))
|
'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
|
_tk_patchlevel = None
|
||||||
def get_tk_patchlevel():
|
def get_tk_patchlevel():
|
||||||
global _tk_patchlevel
|
global _tk_patchlevel
|
||||||
|
|
|
@ -717,9 +717,7 @@ class ListboxTest(AbstractWidgetTest, unittest.TestCase):
|
||||||
self.checkEnumParam(widget, 'activestyle',
|
self.checkEnumParam(widget, 'activestyle',
|
||||||
'dotbox', 'none', 'underline')
|
'dotbox', 'none', 'underline')
|
||||||
|
|
||||||
@requires_tcl(8, 6, 5)
|
test_justify = requires_tcl(8, 6, 5)(StandardOptionsTests.test_justify)
|
||||||
def test_justify(self):
|
|
||||||
AbstractWidgetTest.test_justify(self)
|
|
||||||
|
|
||||||
def test_listvariable(self):
|
def test_listvariable(self):
|
||||||
widget = self.create()
|
widget = self.create()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue