|
6 | 6 | from tkinter.ttk import setup_master, Scale |
7 | 7 | from tkinter.test.support import (tcl_version, requires_tcl, get_tk_patchlevel, |
8 | 8 | pixels_conv, tcl_obj_eq) |
| 9 | +import test.support |
9 | 10 |
|
10 | 11 |
|
11 | 12 | noconv = False |
@@ -234,8 +235,14 @@ def test_bitmap(self): |
234 | 235 | widget = self.create() |
235 | 236 | self.checkParam(widget, 'bitmap', 'questhead') |
236 | 237 | self.checkParam(widget, 'bitmap', 'gray50') |
237 | | - self.checkInvalidParam(widget, 'bitmap', 'spam', |
238 | | - errmsg='bitmap "spam" not defined') |
| 238 | + filename = test.support.findfile('python.xbm', subdir='imghdrdata') |
| 239 | + self.checkParam(widget, 'bitmap', '@' + filename) |
| 240 | + # Cocoa Tk widgets don't detect invalid -bitmap values |
| 241 | + # See https://core.tcl.tk/tk/info/31cd33dbf0 |
| 242 | + if not ('aqua' in self.root.tk.call('tk', 'windowingsystem') and |
| 243 | + 'AppKit' in self.root.winfo_server()): |
| 244 | + self.checkInvalidParam(widget, 'bitmap', 'spam', |
| 245 | + errmsg='bitmap "spam" not defined') |
239 | 246 |
|
240 | 247 | def test_borderwidth(self): |
241 | 248 | widget = self.create() |
@@ -495,7 +502,6 @@ def test(self, option=option): |
495 | 502 | return decorator |
496 | 503 |
|
497 | 504 | def setUpModule(): |
498 | | - import test.support |
499 | 505 | if test.support.verbose: |
500 | 506 | tcl = tkinter.Tcl() |
501 | 507 | print('patchlevel =', tcl.call('info', 'patchlevel')) |
0 commit comments