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. |
""" |
if yieldtype is None: |
yieldtype = py.test.collect.Item |
if isinstance(self, yieldtype): |
try: |
self._skipbykeyword(keyword) |
yield self |
except Skipped: |
if reporterror is not None: |
excinfo = py.code.ExceptionInfo() |
reporterror((excinfo, self)) |
else: |
if not isinstance(self, py.test.collect.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)) |