diff --git a/py/test/rsession/testing/test_executor.py b/py/test/rsession/testing/test_executor.py index 0b9f75d19..13f15bfa1 100644 --- a/py/test/rsession/testing/test_executor.py +++ b/py/test/rsession/testing/test_executor.py @@ -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"