Skip to content

Commit ef035e7

Browse files
committed
Custom Item name: remove unwanted attribute
1 parent 54c0445 commit ef035e7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pytest_reportportal/service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ def _process_attributes(self, item):
629629
for issue_id in self._get_issue_ids(marker):
630630
attributes.add((marker.name, issue_id))
631631
continue
632+
if marker.name == 'name':
633+
continue
632634
if marker.name in self._config.rp_ignore_attributes \
633635
or marker.name in PYTEST_MARKS_IGNORE:
634636
continue
@@ -637,8 +639,7 @@ def _process_attributes(self, item):
637639
else:
638640
attributes.add((None, marker.name))
639641

640-
return [self._to_attribute(attribute)
641-
for attribute in attributes]
642+
return [self._to_attribute(attribute) for attribute in attributes]
642643

643644
def _process_metadata_item_start(self, leaf: Dict[str, Any]):
644645
"""

tests/integration/test_custom_name.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ def test_custom_attribute_report(mock_client_init, test, expected):
4141
call_args = mock_client.start_test_item.call_args_list
4242
step_call_args = call_args[0][1]
4343
assert step_call_args['name'] == expected, 'Incorrect item name'
44+
assert step_call_args['attributes'] == [], 'No attributes should be added for the test item'

0 commit comments

Comments
 (0)