summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-02 14:41:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-02 14:41:23 (GMT)
commit28f0beaff692117a55ab919e87d336044935a0ab (patch)
tree21511aacd64f62f7faa6bb158f9551bfc5996d5c
parentbf30c9f01ab093fe1f0753a2332dea4ed99c7d9c (diff)
downloadcpython-28f0beaff692117a55ab919e87d336044935a0ab.zip
cpython-28f0beaff692117a55ab919e87d336044935a0ab.tar.gz
cpython-28f0beaff692117a55ab919e87d336044935a0ab.tar.bz2
Issue #19085. Try to fix tkinter tests on Windows.
-rw-r--r--Lib/tkinter/test/test_tkinter/test_widgets.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index 3475ad0..141bbf6 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -73,7 +73,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
def test_screen(self):
widget = self.create()
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,
errmsg="can't modify -screen option after widget is created")
widget2 = self.create(screen=display)
@@ -82,13 +85,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
def test_use(self):
widget = self.create()
self.assertEqual(widget['use'], '')
- widget1 = self.create(container=True)
- self.assertEqual(widget1['use'], '')
- self.checkInvalidParam(widget1, 'use', '0x44022',
- errmsg="can't modify -use option after widget is created")
- wid = hex(widget1.winfo_id())
+ parent = self.create(container=True)
+ wid = parent.winfo_id()
widget2 = self.create(use=wid)
- self.assertEqual(widget2['use'], wid)
+ self.assertEqual(int(widget2['use']), wid)
@add_standard_options(StandardOptionsTests)