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"
def test_run_executor(self): ex = RunExecutor(ItemTestPassing("pass", self.config), config=self.config) outcome = ex.execute() assert outcome.passed ex = RunExecutor(ItemTestFailing("fail", self.config), config=self.config) outcome = ex.execute() assert not outcome.passed ex = RunExecutor(ItemTestSkipping("skip", self.config), config=self.config) outcome = ex.execute() assert outcome.skipped assert not outcome.passed assert not outcome.excinfo
def test_run_executor_capture(self): ex = RunExecutor(ItemTestPrinting("print", self.config), config=self.config) outcome = ex.execute() assert outcome.stdout == "hello\n"
def test_executor_explicit_Faile_no_excinfo(self): ex = RunExecutor(ItemTestFailingExplicitEmpty("failexx", self.config), config=self.config) outcome = ex.execute() assert not outcome.passed
def plain_runner(item, session, reporter): r = RunExecutor(item, usepdb=session.config.option.usepdb, reporter=reporter, config=session.config) outcome = r.execute() outcome = ReprOutcome(outcome.make_repr(session.config.option.tbstyle)) return outcome