aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/tkinter/test/widget_tests.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-03 21:33:33 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-03 21:33:33 +0200
commitb3de1a720a7dffcf86bf7e7301263590b5972186 (patch)
tree51af77f180ef1af218d513661b7814ca7c35b80e /Lib/tkinter/test/widget_tests.py
parent1317e1446805f1ab6b3299eef0a2910bab2887e0 (diff)
downloadcpython-b3de1a720a7dffcf86bf7e7301263590b5972186.tar.gz
cpython-b3de1a720a7dffcf86bf7e7301263590b5972186.zip
Issue #19761: Fixed Tkinter tests on OS X.
Diffstat (limited to 'Lib/tkinter/test/widget_tests.py')
-rw-r--r--Lib/tkinter/test/widget_tests.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/tkinter/test/widget_tests.py b/Lib/tkinter/test/widget_tests.py
index ac194a8995a..a9820a7f689 100644
--- a/Lib/tkinter/test/widget_tests.py
+++ b/Lib/tkinter/test/widget_tests.py
@@ -6,6 +6,7 @@ import tkinter
from tkinter.ttk import setup_master, Scale
from tkinter.test.support import (tcl_version, requires_tcl, get_tk_patchlevel,
pixels_conv, tcl_obj_eq)
+import test.support
noconv = False
@@ -234,8 +235,14 @@ class StandardOptionsTests:
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.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()
@@ -495,7 +502,6 @@ def add_standard_options(*source_classes):
return decorator
def setUpModule():
- import test.support
if test.support.verbose:
tcl = tkinter.Tcl()
print('patchlevel =', tcl.call('info', 'patchlevel'))