Skip to content

Commit c1f1569

Browse files
committed
ehanced fix for issue #37
1 parent 775e6c9 commit c1f1569

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pytest_reportportal/service.py

Lines changed: 5 additions & 10 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,14 @@ 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):
110+
def _get_tags(self, item):
111111
# 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')
113+
mark_plugin = item.config.pluginmanager.getplugin('mark')
114114
if not mark_plugin:
115115
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]
116+
return [k for k in item.keywords if item.get_marker(k) is not None
117+
and k not in self.ignored_tags]
123118

124119
def finish_pytest_item(self, status, issue=None):
125120
self._stop_if_necessary()

0 commit comments

Comments
 (0)