Skip to content

Commit

Permalink
Merge pull request #367 from virdok/develop
Browse files Browse the repository at this point in the history
Fixed mtultiple chained errors thrown when using pytest Tavern
  • Loading branch information
HardNorth authored Jun 10, 2024
2 parents 922edfa + be082f8 commit 1c33b33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pytest_reportportal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,18 @@ def _get_code_ref(self, item):
# same path on different systems and do not affect Test Case ID on
# different systems
path = os.path.relpath(str(item.fspath), ROOT_DIR).replace('\\', '/')
method_name = item.originalname if item.originalname is not None \
method_name = item.originalname if hasattr(item, 'originalname') \
and item.originalname is not None \
else item.name
parent = item.parent
classes = [method_name]
while not isinstance(parent, Module):
if not isinstance(parent, Instance):
if not isinstance(parent, Instance) and hasattr(parent, 'name'):
classes.append(parent.name)
parent = parent.parent
if hasattr(parent, 'parent'):
parent = parent.parent
else:
break
classes.reverse()
class_path = '.'.join(classes)
return '{0}:{1}'.format(path, class_path)
Expand Down

0 comments on commit 1c33b33

Please sign in to comment.