/home/johnny/projects/merlinux/py/dist/py/magic/assertion.py:29
def invoke(): -> py.magic.patch(__builtin__, 'AssertionError', AssertionError)
/home/johnny/projects/merlinux/py/dist/py/magic/invoke.py:14
def invoke(assertion=False, compile=False):
""" invoke magic, currently you can specify:
assertion patches the builtin AssertionError to try to give
more meaningful AssertionErrors, which by means
of deploying a mini-interpreter constructs
a useful error message.
"""
if assertion:
from py.__.magic import assertion
-> assertion.invoke()
if compile:
py.magic.patch(cpy_builtin, 'compile', py.code.compile )
/home/johnny/projects/merlinux/py/dist/py/test/session.py:18
def header(self, colitems):
""" setup any neccessary resources. """
if not self.config.option.nomagic:
-> py.magic.invoke(assertion=1)
/home/johnny/projects/merlinux/py/dist/py/test/terminal/terminal.py:122
def header(self, colitems):
-> super(TerminalSession, self).header(colitems)
self.out.sep("=", "test process starts")
option = self.config.option
modes = []
for name in 'looponfailing', 'exitfirst', 'nomagic':
if getattr(option, name):
modes.append(name)
if option._fromremote:
modes.insert(0, 'child process')
else:
modes.insert(0, 'inprocess')
mode = "/".join(modes)
self.out.line("testing-mode: %s" % mode)
self.out.line("executable: %s (%s)" %
(py.std.sys.executable, repr_pythonversion()))
rev = py.__package__.getrev()
self.out.line("using py lib: %s <rev %s>" % (
py.path.local(py.__file__).dirpath(), rev))
if self.config.option.traceconfig or self.config.option.verbose:
for x in colitems:
self.out.line("test target: %s" %(x.fspath,))
for i,x in py.builtin.enumerate(self.config._initialconfigmodules):
self.out.line("initial conf %d: %s" %(i, x.__file__))
#for i, x in py.builtin.enumerate(py.test.config.configpaths):
# self.out.line("initial testconfig %d: %s" %(i, x))
#additional = py.test.config.getfirst('additionalinfo')
#if additional:
# for key, descr in additional():
# self.out.line("%s: %s" %(key, descr))
self.out.line()
self.starttime = now()
/home/johnny/projects/merlinux/py/dist/py/test/session.py:42
def main(self, args):
""" main loop for running tests. """
colitems = self._map2colitems(args)
try:
-> self.header(colitems)
try:
for colitem in colitems:
colitem.option = self.config.option
self.runtraced(colitem)
except KeyboardInterrupt:
raise
except:
self.footer(colitems)
else:
self.footer(colitems)
except Exit, ex:
pass
# return [(fspath as string, [names as string])]
return [(str(item.listchain()[0].fspath), item.listnames())
for item, outcome in self.getitemoutcomepairs(py.test.Item.Failed)]
/home/johnny/projects/merlinux/py/dist/py/test/terminal/terminal.py:34
def main(self, args):
if self.config.option._remote:
from py.__.test.terminal import remote
return remote.main(self.config, self._file, self.config._origargs)
else:
-> return super(TerminalSession, self).main(args)
/home/johnny/projects/merlinux/py/dist/py/documentation/example/pytest/test_failures.py:8
def test_failure_demo_fails_properly():
config, args = py.test.Config.parse([])
session = config.getsessionclass()(config, py.std.sys.stdout)
-> session.main([failure_demo])
l = session.getitemoutcomepairs(py.test.Item.Failed)
assert len(l) == 21
l = session.getitemoutcomepairs(py.test.Item.Passed)
assert not l
/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