[py-svn] r11452 - py/dist/py/test/tkinter

jan at codespeak.net jan at codespeak.net
Tue Apr 26 12:16:10 CEST 2005


Author: jan
Date: Tue Apr 26 12:16:10 2005
New Revision: 11452

Modified:
   py/dist/py/test/tkinter/backend.py
Log:
fixed args of thread


Modified: py/dist/py/test/tkinter/backend.py
==============================================================================
--- py/dist/py/test/tkinter/backend.py	(original)
+++ py/dist/py/test/tkinter/backend.py	Tue Apr 26 12:16:10 2005
@@ -64,6 +64,29 @@
         self.add_report(report)
         return report.full_id[:]
 
+
+class ReportStore:
+    ReportClass = util.TestReport2
+
+    def __init__(self):
+        self._reports = []
+
+    def add(self, report):
+        self._reports.append(report)
+
+    def get(self, **kwargs):
+        filter_dict = {'failed': self._select_failed }
+        selected_reports = []
+        for name, function in filter_dict.items():
+            if kwargs.has_key(name) and kwargs[name] == True:
+                selected_reports.extend([report for report in self._reports
+                                         if function(report)])
+        return selected_reports
+
+    def _select_failed(self, report):
+        return report.status == self.ReportClass.Status.Failed()
+
+
 class RepositoryBackend:
 
     def __init__(self, config = Null()):
@@ -129,25 +152,24 @@
         remote(channel, tests = tests, args = args)
         ''')
         self.channel.send((args, tests))
-        self.waitfinish_thread = threading.Thread(target = self.waitfinish,
-                                                  args = [self.channel])
+        self.waitfinish_thread = threading.Thread(target = waitfinish, args = (self.channel,))
         self.waitfinish_thread.start()
 
-    def waitfinish(self, channel):
-        try:
-            while 1:
-                try:
-                    channel.waitclose(1)
-                except (IOError, py.error.Error):
-                    continue
-                break
-        finally:
+def waitfinish(channel):
+    try:
+        while 1:
             try:
-                channel.gateway.exit()
-            except EOFError:
-                # the gateway receiver callback will get woken up
-                # and see an EOFError exception
-                pass
+                channel.waitclose(1)
+            except (IOError, py.error.Error):
+                continue
+            break
+    finally:
+        try:
+            channel.gateway.exit()
+        except EOFError:
+            # the gateway receiver callback will get woken up
+            # and see an EOFError exception
+            pass
             
             
                 



More information about the pytest-commit mailing list