Skip to content

Commit bcbb600

Browse files
kleptogYury Krasouski
authored andcommitted
Fix test item nesting for non-Function tests. (#67)
The original code assumed that all test items were subclasses of "Function", but they aren't. The easy case is PyFlakes tests, but there are many more examples. So use an explicit sentinel instead of assuming. Fixes: #66
1 parent 0122f19 commit bcbb600

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytest_reportportal/service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def collect_tests(self, session):
112112
parts = self._get_item_parts(item)
113113
# Add all parts in revers order to parts_out
114114
parts_out.extend(reversed(parts))
115+
parts_out.append(None) # marker
115116
while parts:
116117
part = parts.pop(0)
117118
if part in self._start_stack:
@@ -175,9 +176,9 @@ def finish_pytest_item(self, status, issue=None):
175176
self.RP.finish_test_item(**fta_rq)
176177

177178
while self._finish_stack:
178-
if isinstance(self._finish_stack[0], Function):
179-
break
180179
part = self._finish_stack.pop(0)
180+
if part is None:
181+
break
181182
if self._finish_stack.count(part):
182183
continue
183184
payload = {

0 commit comments

Comments
 (0)