Skip to content

Commit 775e6c9

Browse files
author
Alexander Iljushkin
authored
Merge pull request #38 from krasoffski/issue_37
Add fix for issue #37
2 parents 1758c24 + 7f5237a commit 775e6c9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pytest_reportportal/service.py

Lines changed: 9 additions & 6 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
7+
from six import with_metaclass, iteritems
88
from six.moves import queue
99

1010
from reportportal_client import ReportPortalServiceAsync
@@ -111,13 +111,16 @@ def _get_tags(self, test_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
113113
mark_plugin = test_item.config.pluginmanager.getplugin('mark')
114-
if mark_plugin:
115-
keywords = test_item.keywords
116-
marks = mark_plugin.MarkMapping(keywords)._mymarks
117-
return [m for m in marks if m not in self.ignored_tags]
118-
else:
114+
if not mark_plugin:
119115
return []
120116

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]
123+
121124
def finish_pytest_item(self, status, issue=None):
122125
self._stop_if_necessary()
123126
if self.RP is None:

0 commit comments

Comments
 (0)