/home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_rsession.py:224
def test_setup_teardown_run_ssh(self):
hosts = ['localhost']
allevents = []
config, args = py.test.Config.parse([])
session_options.bind_config(config)
nodes = init_hosts(allevents.append, hosts, 'pytesttest', pkgdir,
rsync_roots=["py"], optimise_localhost=False, remote_options=remote_options.d)
from py.__.test.rsession.testing.test_executor \
import ItemTestPassing, ItemTestFailing, ItemTestSkipping
rootcol = py.test.collect.Directory(pkgdir.dirpath())
-> itempass = rootcol.getitembynames(funcpass_spec)
itemfail = rootcol.getitembynames(funcfail_spec)
itemskip = rootcol.getitembynames(funcskip_spec)
itemprint = rootcol.getitembynames(funcprint_spec)
# actually run some tests
for node in nodes:
node.send(itempass)
node.send(itemfail)
node.send(itemskip)
node.send(itemprint)
teardown_hosts(allevents.append, [node.channel for node in nodes], nodes)
events = [i for i in allevents
if isinstance(i, report.ReceivedItemOutcome)]
passed = [i for i in events
if i.outcome.passed]
skipped = [i for i in events
if i.outcome.skipped]
assert len(passed) == 2 * len(nodes)
assert len(skipped) == len(nodes)
assert len(events) == 4 * len(nodes)
# one of passed for each node has non-empty stdout
passed_stdout = [i for i in passed if i.outcome.stdout == 'samfing\n']
assert len(passed_stdout) == len(nodes), passed
/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