[svn r38577] Test for explicit Failed

--HG--
branch : trunk
This commit is contained in:
fijal 2007-02-12 16:40:04 +01:00
parent ba07ab5533
commit 53c204962a
1 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,7 @@ from py.__.test.rsession.executor import RunExecutor, BoxExecutor,\
AsyncExecutor, ApigenExecutor
from py.__.test.rsession.outcome import ReprOutcome
from py.__.test.rsession.testing.basetest import BasicRsessionTest
from py.__.test.outcome import Failed
def setup_module(mod):
if py.std.sys.platform == "win32":
@ -32,6 +33,10 @@ class ItemTestPrinting(Item):
def run(self):
print "hello"
class ItemTestFailingExplicit(Item):
def run(self):
raise Failed(excinfo="3")
class TestExecutor(BasicRsessionTest):
def test_run_executor(self):
ex = RunExecutor(ItemTestPassing("pass", self.config), config=self.config)
@ -145,3 +150,11 @@ class TestExecutor(BasicRsessionTest):
assert out1.passed
assert out2.passed
assert not out3.passed
def test_executor_explicit_Failed(self):
ex = RunExecutor(ItemTestFailingExplicit("failex", self.config),
config=self.config)
outcome = ex.execute()
assert not outcome.passed
assert outcome.excinfo == "3"