[py-svn] r39340 - in py/trunk/py/test/rsession: . testing
fijal at codespeak.net
fijal at codespeak.net
Fri Feb 23 15:22:51 CET 2007
Author: fijal
Date: Fri Feb 23 15:22:50 2007
New Revision: 39340
Modified:
py/trunk/py/test/rsession/executor.py
py/trunk/py/test/rsession/testing/test_executor.py
Log:
A fix and a test. Thanks Marian Shubert for reporting problem
Modified: py/trunk/py/test/rsession/executor.py
==============================================================================
--- py/trunk/py/test/rsession/executor.py (original)
+++ py/trunk/py/test/rsession/executor.py Fri Feb 23 15:22:50 2007
@@ -40,7 +40,7 @@
raise
except:
e = sys.exc_info()[1]
- if isinstance(e, Failed):
+ if isinstance(e, Failed) and e.excinfo:
excinfo = e.excinfo
else:
excinfo = py.code.ExceptionInfo()
Modified: py/trunk/py/test/rsession/testing/test_executor.py
==============================================================================
--- py/trunk/py/test/rsession/testing/test_executor.py (original)
+++ py/trunk/py/test/rsession/testing/test_executor.py Fri Feb 23 15:22:50 2007
@@ -37,6 +37,10 @@
def run(self):
raise Failed(excinfo="3")
+class ItemTestFailingExplicitEmpty(Item):
+ def run(self):
+ py.test.raises(ValueError, lambda : 123)
+
class TestExecutor(BasicRsessionTest):
def test_run_executor(self):
ex = RunExecutor(ItemTestPassing("pass", self.config), config=self.config)
@@ -158,3 +162,10 @@
outcome = ex.execute()
assert not outcome.passed
assert outcome.excinfo == "3"
+
+ def test_executor_explicit_Faile_no_excinfo(self):
+ ex = RunExecutor(ItemTestFailingExplicitEmpty("failexx", self.config),
+ config=self.config)
+ outcome = ex.execute()
+ assert not outcome.passed
+
More information about the py-svn
mailing list