[Python-checkins] r85122 - python/branches/release27-maint-ttk-debug-on-xp5/Lib/lib-tk/test/test_ttk/test_extensions.py

hirokazu.yamamoto python-checkins at python.org
Thu Sep 30 04:51:26 CEST 2010


Author: hirokazu.yamamoto
Date: Thu Sep 30 04:51:26 2010
New Revision: 85122

Log:
More debug print ...

Modified:
   python/branches/release27-maint-ttk-debug-on-xp5/Lib/lib-tk/test/test_ttk/test_extensions.py

Modified: python/branches/release27-maint-ttk-debug-on-xp5/Lib/lib-tk/test/test_ttk/test_extensions.py
==============================================================================
--- python/branches/release27-maint-ttk-debug-on-xp5/Lib/lib-tk/test/test_ttk/test_extensions.py	(original)
+++ python/branches/release27-maint-ttk-debug-on-xp5/Lib/lib-tk/test/test_ttk/test_extensions.py	Thu Sep 30 04:51:26 2010
@@ -13,7 +13,7 @@
 requires('gui')
 
 CODES_SIZE = 100
-WAIT = 10 * 60 # XXX: adjust here
+WAIT = 1 * 60 # XXX: adjust here
 
 
 class LabeledScaleTest(unittest.TestCase):
@@ -114,9 +114,13 @@
     def test_horizontal_range(self):
         lscale = ttk.LabeledScale(from_=0, to=10)
         lscale.pack()
+        print("===> enter lscale.wait_visibility....")
         lscale.wait_visibility()
+        print("===> leave lscale.wait_visibility....")
         lscale.update()
 
+        time.sleep(2 * 60)
+
         linfo_1 = lscale.label.place_info()
         prev_xcoord = lscale.scale.coords()[0]
         self.assertEqual(prev_xcoord, int(linfo_1['x']))
@@ -281,13 +285,23 @@
 
 if __name__ == "__main__":
     codes = collections.deque([None] * CODES_SIZE)
+    code_count = 0
     def tracefunc(frame, event, arg):
+        global code_count
+        code_count += 1
         codes.append(frame.f_code)
         codes.popleft()
     sys.settrace(tracefunc) # only main thread now
 
     def threadfunc():
-        time.sleep(WAIT)
+        while 1:
+            old_code_count = code_count
+            print("----> thread sleeping now...")
+            time.sleep(WAIT)
+            print("----> thread awakened ....")
+            if old_code_count == code_count:
+                break
+        print("===================")
         for code in codes:
             if code is None:
                 continue


More information about the Python-checkins mailing list