Kaydet (Commit) 9788497e authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #19085: Fixed some Tkinter tests on Windows.

üst 5028f4d4
...@@ -73,7 +73,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase): ...@@ -73,7 +73,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
def test_screen(self): def test_screen(self):
widget = self.create() widget = self.create()
self.assertEqual(widget['screen'], '') self.assertEqual(widget['screen'], '')
display = os.environ['DISPLAY'] try:
display = os.environ['DISPLAY']
except KeyError:
self.skipTest('No $DISPLAY set.')
self.checkInvalidParam(widget, 'screen', display, self.checkInvalidParam(widget, 'screen', display,
errmsg="can't modify -screen option after widget is created") errmsg="can't modify -screen option after widget is created")
widget2 = self.create(screen=display) widget2 = self.create(screen=display)
...@@ -82,13 +85,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase): ...@@ -82,13 +85,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
def test_use(self): def test_use(self):
widget = self.create() widget = self.create()
self.assertEqual(widget['use'], '') self.assertEqual(widget['use'], '')
widget1 = self.create(container=True) parent = self.create(container=True)
self.assertEqual(widget1['use'], '') wid = parent.winfo_id()
self.checkInvalidParam(widget1, 'use', '0x44022',
errmsg="can't modify -use option after widget is created")
wid = hex(widget1.winfo_id())
widget2 = self.create(use=wid) widget2 = self.create(use=wid)
self.assertEqual(widget2['use'], wid) self.assertEqual(int(widget2['use']), wid)
@add_standard_options(StandardOptionsTests) @add_standard_options(StandardOptionsTests)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment