diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-03 19:33:21 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-03 19:33:21 (GMT) |
commit | 942aaac7057feb38ce05a3c5062af5fb11eb2ee3 (patch) | |
tree | a2778d4ee18b0ff3aae124a8521728a6745e3022 /Lib/lib-tk/test | |
parent | ccffb25c5496b00cbe519e6d0e1038f61cdec563 (diff) | |
download | cpython-942aaac7057feb38ce05a3c5062af5fb11eb2ee3.zip cpython-942aaac7057feb38ce05a3c5062af5fb11eb2ee3.tar.gz cpython-942aaac7057feb38ce05a3c5062af5fb11eb2ee3.tar.bz2 |
Issue #19761: Fixed Tkinter tests on OS X.
Diffstat (limited to 'Lib/lib-tk/test')
-rw-r--r-- | Lib/lib-tk/test/test_tkinter/test_widgets.py | 9 | ||||
-rw-r--r-- | Lib/lib-tk/test/widget_tests.py | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/Lib/lib-tk/test/test_tkinter/test_widgets.py b/Lib/lib-tk/test/test_tkinter/test_widgets.py index 9c5bba8..4f1a63d 100644 --- a/Lib/lib-tk/test/test_tkinter/test_widgets.py +++ b/Lib/lib-tk/test/test_tkinter/test_widgets.py @@ -326,10 +326,11 @@ class EntryTest(AbstractWidgetTest, unittest.TestCase): self.checkColorParam(widget, 'disabledbackground') def test_insertborderwidth(self): - widget = self.create() - self.checkPixelsParam(widget, 'insertborderwidth', 0, 1.3, -2) - self.checkParam(widget, 'insertborderwidth', 2, expected=1) - self.checkParam(widget, 'insertborderwidth', '10p', expected=1) + widget = self.create(insertwidth=100) + self.checkPixelsParam(widget, 'insertborderwidth', + 0, 1.3, 2.6, 6, -2, '10p') + # insertborderwidth is bounded above by a half of insertwidth. + self.checkParam(widget, 'insertborderwidth', 60, expected=100//2) def test_insertwidth(self): widget = self.create() diff --git a/Lib/lib-tk/test/widget_tests.py b/Lib/lib-tk/test/widget_tests.py index b943a10..2234e3c 100644 --- a/Lib/lib-tk/test/widget_tests.py +++ b/Lib/lib-tk/test/widget_tests.py @@ -6,6 +6,7 @@ import Tkinter from ttk import setup_master, Scale from test_ttk.support import (tcl_version, requires_tcl, get_tk_patchlevel, pixels_conv, tcl_obj_eq) +import test.test_support noconv = noconv_meth = False @@ -253,8 +254,14 @@ class StandardOptionsTests(object): widget = self.create() self.checkParam(widget, 'bitmap', 'questhead') self.checkParam(widget, 'bitmap', 'gray50') - self.checkInvalidParam(widget, 'bitmap', 'spam', - errmsg='bitmap "spam" not defined') + filename = test.test_support.findfile('python.xbm', subdir='imghdrdata') + self.checkParam(widget, 'bitmap', '@' + filename) + # Cocoa Tk widgets don't detect invalid -bitmap values + # See https://core.tcl.tk/tk/info/31cd33dbf0 + if not ('aqua' in self.root.tk.call('tk', 'windowingsystem') and + 'AppKit' in self.root.winfo_server()): + self.checkInvalidParam(widget, 'bitmap', 'spam', + errmsg='bitmap "spam" not defined') def test_borderwidth(self): widget = self.create() @@ -514,7 +521,6 @@ def add_standard_options(*source_classes): return decorator def setUpModule(): - import test.test_support if test.test_support.verbose: tcl = Tkinter.Tcl() print 'patchlevel =', tcl.call('info', 'patchlevel') |