/home/johnny/projects/merlinux/py/dist/py/test/rsession/reporter.py:44
def report(self, what):
repfun = getattr(self, "report_" + what.__class__.__name__,
self.report_unknown)
try:
-> repfun(what)
except (KeyboardInterrupt, SystemExit):
raise
except:
print "Internal reporting problem"
excinfo = py.code.ExceptionInfo()
for i in excinfo.traceback:
print str(i)[2:-1]
print excinfo
/home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_reporter.py:49
def boxfun(config, item, outcomes):
r = self.reporter(config, ["localhost"])
for outcome in outcomes:
-> r.report(report.ReceivedItemOutcome(None, item, outcome))
/home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_reporter.py:54
def report_received_item_outcome(self):
config, args = py.test.Config.parse(["some_sub"])
# we just go...
rootcol = py.test.collect.Directory(self.pkgdir.dirpath())
item = rootcol.getitembynames(funcpass_spec)
outcomes = self.prepare_outcomes()
def boxfun(config, item, outcomes):
r = self.reporter(config, ["localhost"])
for outcome in outcomes:
r.report(report.ReceivedItemOutcome(None, item, outcome))
s = StringIO()
stdoutcopy = sys.stdout
sys.stdout = s
-> boxfun(config, item, outcomes)
sys.stdout = stdoutcopy
return s.getvalue()
/home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_rest.py:270
def test_report_received_item_outcome(self):
-> val = self.report_received_item_outcome()
expected = """\
* localhost\: **FAILED** py/test/rsession/testing/test\_slave.py/funcpass
* localhost\: **SKIPPED** py/test/rsession/testing/test\_slave.py/funcpass
* localhost\: **FAILED** py/test/rsession/testing/test\_slave.py/funcpass
* localhost\: **PASSED** py/test/rsession/testing/test\_slave.py/funcpass
"""
print val
assert val == expected
/home/johnny/projects/merlinux/py/dist/py/test/item.py:79
def execute(self, target, *args):
""" default implementation for calling a test target is to
simply call it.
"""
-> target(*args)
/home/johnny/projects/merlinux/py/dist/py/test/item.py:73
def run(self):
self.state.prepare(self)
-> self.execute(self.obj, *self.args)
/home/johnny/projects/merlinux/py/dist/py/test/rsession/executor.py:22
def execute(self):
try:
-> self.item.run()
outcome = Outcome()
except py.test.Item.Skipped, e:
outcome = Outcome(skipped=str(e))
except (KeyboardInterrupt, SystemExit):
raise
except:
excinfo = py.code.ExceptionInfo()
if isinstance(self.item, py.test.Function):
fun = self.item.obj # hope this is stable
code = py.code.Code(fun)
excinfo.traceback = excinfo.traceback.cut(
path=code.path, firstlineno=code.firstlineno)
outcome = Outcome(excinfo=excinfo, setupfailure=False)
if self.usepdb:
if self.reporter is not None:
self.reporter(report.ImmediateFailure(self.item,
ReprOutcome(outcome.make_repr())))
import pdb
pdb.post_mortem(excinfo._excinfo[2])
# XXX hmm, we probably will not like to continue from that point
# or we do?
raise SystemExit()
outcome.stdout = ""
outcome.stderr = ""
return outcome
/home/johnny/projects/merlinux/py/dist/py/test/rsession/local.py:31
def plain_runner(item, session, reporter):
# box executor is doing stdout/err catching for us, let's do it here
startcapture(session)
r = RunExecutor(item, usepdb=session.config.option.usepdb, reporter=reporter)
-> outcome = r.execute()
outcome = ReprOutcome(outcome.make_repr())
outcome.stdout, outcome.stderr = finishcapture(session)
return outcome
/home/johnny/projects/merlinux/py/dist/py/test/rsession/local.py:47
def apigen_runner(item, session, reporter):
r = RunExecutor(item, reporter=reporter)
session.tracer.start_tracing()
-> retval = plain_runner(item, session, reporter)
session.tracer.end_tracing()
return retval