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

hpk at codespeak.net hpk at codespeak.net
Tue Aug 22 16:13:31 CEST 2006


Author: hpk
Date: Tue Aug 22 16:13:29 2006
New Revision: 31476

Modified:
   py/branch/distributed/py/test/rsession/executor.py
   py/branch/distributed/py/test/rsession/outcome.py
Log:
(fijal, hpk) removed Outcome class hierarchy. 


Modified: py/branch/distributed/py/test/rsession/executor.py
==============================================================================
--- py/branch/distributed/py/test/rsession/executor.py	(original)
+++ py/branch/distributed/py/test/rsession/executor.py	Tue Aug 22 16:13:29 2006
@@ -3,7 +3,7 @@
 
 import py
 
-from py.__.test.rsession.outcome import FailingOutcome, PassingOutcome
+from py.__.test.rsession.outcome import Outcome 
 
 class Executor(object):
     def __init__(self, fun, setup=lambda: None): 
@@ -23,8 +23,8 @@
     def execute(self):
         excinfo = self._execute(self.setup)
         if excinfo is not None:
-            return FailingOutcome(excinfo, setupfailure=True)
+            return Outcome(excinfo=excinfo, setupfailure=True)
         excinfo = self._execute(self.fun)
         if excinfo is not None:
-            return FailingOutcome(excinfo, setupfailure=False)
-        return PassingOutcome()
+            return Outcome(excinfo=excinfo, setupfailure=False)
+        return Outcome()

Modified: py/branch/distributed/py/test/rsession/outcome.py
==============================================================================
--- py/branch/distributed/py/test/rsession/outcome.py	(original)
+++ py/branch/distributed/py/test/rsession/outcome.py	Tue Aug 22 16:13:29 2006
@@ -3,20 +3,14 @@
 """
 
 class Outcome(object):
+    def __init__(self, setupfailure=False, excinfo=None):
+        self.passed = not excinfo 
+        self.setupfailure = setupfailure 
+        self.excinfo = excinfo 
+    
     def make_repr(self):
         return (self.passed, self.setupfailure, repr(self.excinfo))
 
-class FailingOutcome(Outcome):
-    passed = False
-    def __init__(self, excinfo, setupfailure=False):
-        self.excinfo = excinfo
-        self.setupfailure = setupfailure     
-
-class PassingOutcome(Outcome):
-    passed = True
-    setupfailure = False 
-    excinfo = None
-
 class ReprOutcome(object):
     def __init__(self, repr_tuple):
         self.passed, self.setupfailure, self.excinfo = repr_tuple



More information about the pytest-commit mailing list