yield stop item instances from flattening the collector.
XXX deprecated: this way of iteration is not safe in all
cases. Mostly fixed, need to introduce skipped-by-keyword
def tryiter(self, yieldtype=None, reporterror=None, keyword=None):
origin: test.collect.Collector
where:
changes in __dict__ after execution:
exceptions that might appear during execution:
function source:
def tryiter(self, yieldtype=None, reporterror=None, keyword=None):
""" yield stop item instances from flattening the collector.
XXX deprecated: this way of iteration is not safe in all
cases. Mostly fixed, need to introduce skipped-by-keyword
"""
if yieldtype is None:
yieldtype = py.test.Item
if isinstance(self, yieldtype):
try:
self.skipbykeyword(keyword)
yield self
except py.test.Item.Skipped:
if reporterror is not None:
excinfo = py.code.ExceptionInfo()
reporterror((excinfo, self))
else:
if not isinstance(self, py.test.Item):
try:
if reporterror is not None:
reporterror((None, self))
for x in self.run():
for y in self.join(x).tryiter(yieldtype, reporterror, keyword):
yield y
except KeyboardInterrupt:
raise
except:
if reporterror is not None:
excinfo = py.code.ExceptionInfo()
reporterror((excinfo, self))
called in /home/johnny/projects/merlinux/py/dist/py/test/terminal/terminal.py
traceback test.collect.Generator.tryiter.0
called in /home/johnny/projects/merlinux/py/dist/py/test/collect.py
traceback test.collect.Generator.tryiter.1
called in /home/johnny/projects/merlinux/py/dist/py/test/collect.py