Skip to content

Commit e9526af

Browse files
author
Alexander Iljushkin
authored
Merge pull request #41 from krasoffski/issue_37_2
Enhanced fix for issue #37
2 parents 7f1daf5 + 446224a commit e9526af

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

pytest_reportportal/service.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
from time import time
7-
from six import with_metaclass, iteritems
7+
from six import with_metaclass
88
from six.moves import queue
99

1010
from reportportal_client import ReportPortalServiceAsync
@@ -107,19 +107,11 @@ def start_pytest_item(self, test_item=None):
107107
'request_body=%s', start_rq)
108108
self.RP.start_test_item(**start_rq)
109109

110-
def _get_tags(self, test_item):
111-
# try to extract names of @pytest.mark.* decorators used for test item
110+
def _get_tags(self, item):
111+
# Try to extract names of @pytest.mark.* decorators used for test item
112112
# and exclude those which present in rp_ignore_tags parameter
113-
mark_plugin = test_item.config.pluginmanager.getplugin('mark')
114-
if not mark_plugin:
115-
return []
116-
117-
mark_names = set()
118-
for key, value in iteritems(test_item.keywords):
119-
if (isinstance(value, mark_plugin.MarkInfo) or
120-
isinstance(value, mark_plugin.MarkDecorator)):
121-
mark_names.add(key)
122-
return [m for m in mark_names if m not in self.ignored_tags]
113+
return [k for k in item.keywords if item.get_marker(k) is not None
114+
and k not in self.ignored_tags]
123115

124116
def finish_pytest_item(self, status, issue=None):
125117
self._stop_if_necessary()

0 commit comments

Comments
 (0)