Skip to content

Commit

Permalink
Custom Item name: remove unwanted attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 3, 2024
1 parent 54c0445 commit ef035e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pytest_reportportal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ def _process_attributes(self, item):
for issue_id in self._get_issue_ids(marker):
attributes.add((marker.name, issue_id))
continue
if marker.name == 'name':
continue
if marker.name in self._config.rp_ignore_attributes \
or marker.name in PYTEST_MARKS_IGNORE:
continue
Expand All @@ -637,8 +639,7 @@ def _process_attributes(self, item):
else:
attributes.add((None, marker.name))

return [self._to_attribute(attribute)
for attribute in attributes]
return [self._to_attribute(attribute) for attribute in attributes]

def _process_metadata_item_start(self, leaf: Dict[str, Any]):
"""
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_custom_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ def test_custom_attribute_report(mock_client_init, test, expected):
call_args = mock_client.start_test_item.call_args_list
step_call_args = call_args[0][1]
assert step_call_args['name'] == expected, 'Incorrect item name'
assert step_call_args['attributes'] == [], 'No attributes should be added for the test item'

0 comments on commit ef035e7

Please sign in to comment.