Commit 6bf15d10 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #19085: Fixed some Tkinter tests on Windows.

parent 0af7d1ee
...@@ -70,7 +70,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase): ...@@ -70,7 +70,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'], '')
try:
display = os.environ['DISPLAY'] 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)
...@@ -79,13 +82,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase): ...@@ -79,13 +82,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