[py-svn] r31547 - py/branch/distributed/py/test/rsession

fijal at codespeak.net fijal at codespeak.net
Wed Aug 23 15:19:07 CEST 2006


Author: fijal
Date: Wed Aug 23 15:19:05 2006
New Revision: 31547

Modified:
   py/branch/distributed/py/test/rsession/report.py
Log:
Fixed test.


Modified: py/branch/distributed/py/test/rsession/report.py
==============================================================================
--- py/branch/distributed/py/test/rsession/report.py	(original)
+++ py/branch/distributed/py/test/rsession/report.py	Wed Aug 23 15:19:05 2006
@@ -10,22 +10,23 @@
 #def report(msg_type, message):
 #    pass
 
-def report_error(excinfo):
-    if isinstance(excinfo, py.test.Item.Skipped):
-        # we need to dispatch this info
-        report("skipped", excinfo)
-    else:
-        report("itererror", excinfo)
+##def report_error(excinfo):
+##    if isinstance(excinfo, py.test.Item.Skipped):
+##        # we need to dispatch this info
+##        report(Skipped(excinfo))
+##    else:
+##        report("itererror", excinfo)
 
 def wrapcall(reporter, func, *args, **kwargs):
     reporter(CallStart(func, args, kwargs))
     try:
-        return func(*args, **kwargs)
+        retval = func(*args, **kwargs)
     except:
         reporter(CallException(func, args, kwargs))
         raise
     else:
         reporter(CallFinish(func, args, kwargs))
+        return retval
 
 # ----------------------------------------------------------------------
 # Reporting Events 
@@ -48,5 +49,20 @@
         self.item = item
         self.outcome = outcome
 
+class CallEvent(ReportEvent):
+    def __init__(self, func, args, kwargs):
+        self.func = func
+        self.args = args
+        self.kwargs = kwargs
+
+class CallStart(CallEvent):
+    pass
+
+class CallException(CallEvent):
+    pass
+
+class CallFinish(CallEvent):
+    pass
+
 # tryiter, main dispatch loop, something else (setup-teardown stuff)
 # 



More information about the pytest-commit mailing list