[Python-checkins] cpython: Issue #19085. Try to fix tkinter tests on Windows.

serhiy.storchaka python-checkins at python.org
Sat Nov 2 15:41:46 CET 2013


http://hg.python.org/cpython/rev/cee56ef59a6a
changeset:   86841:cee56ef59a6a
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Nov 02 16:41:23 2013 +0200
summary:
  Issue #19085. Try to fix tkinter tests on Windows.

files:
  Lib/tkinter/test/test_tkinter/test_widgets.py |  14 +++++-----
  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
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -73,7 +73,10 @@
     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 @@
     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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list