[py-svn] r37721 - py/trunk/py/test/rsession

fijal at codespeak.net fijal at codespeak.net
Thu Feb 1 12:50:38 CET 2007


Author: fijal
Date: Thu Feb  1 12:50:29 2007
New Revision: 37721

Modified:
   py/trunk/py/test/rsession/executor.py
Log:
Fix. !Tests needed!


Modified: py/trunk/py/test/rsession/executor.py
==============================================================================
--- py/trunk/py/test/rsession/executor.py	(original)
+++ py/trunk/py/test/rsession/executor.py	Thu Feb  1 12:50:29 2007
@@ -60,21 +60,19 @@
         self.tracer = tracer
         return super(ApigenExecutor, self).execute()
 
-    def wrap_underlaying(self, target):
-        def f(*args):
-            try:
-                self.tracer.start_tracing()
-                return target(*args)
-            finally:
-                self.tracer.end_tracing()
-        return f
+    def wrap_underlaying(self, target, *args):
+        try:
+            self.tracer.start_tracing()
+            return target(*args)
+        finally:
+            self.tracer.end_tracing()
 
     def run(self):
         """ We want to trace *only* function objects here. Unsure
         what to do with custom collectors at all
         """
-        if hasattr(self.item, 'obj') and type(self.item.obj) is py.test.Function:
-            self.item.obj = self.wrap_underlaying(self.item.obj)
+        if hasattr(self.item, 'obj') and type(self.item) is py.test.Function:
+            self.item.execute = self.wrap_underlaying
         self.item.run()
 
 class BoxExecutor(RunExecutor):



More information about the pytest-commit mailing list