[Python-checkins] cpython (2.7): Issue #19085: Fixed some Tkinter tests on Windows.

serhiy.storchaka python-checkins at python.org
Sat Nov 2 17:54:18 CET 2013


http://hg.python.org/cpython/rev/4a2afda8f187
changeset:   86854:4a2afda8f187
branch:      2.7
parent:      86849:2b085aba89f9
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Nov 02 18:50:53 2013 +0200
summary:
  Issue #19085: Fixed some Tkinter tests on Windows.

files:
  Lib/lib-tk/test/test_tkinter/test_widgets.py |  14 +++++-----
  1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/Lib/lib-tk/test/test_tkinter/test_widgets.py b/Lib/lib-tk/test/test_tkinter/test_widgets.py
--- a/Lib/lib-tk/test/test_tkinter/test_widgets.py
+++ b/Lib/lib-tk/test/test_tkinter/test_widgets.py
@@ -70,7 +70,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)
@@ -79,13 +82,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