Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed mtultiple chained errors thrown when using pytest Tavern #367

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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