|
4 | 4 | import pytest |
5 | 5 |
|
6 | 6 | from time import time |
7 | | -from six import with_metaclass, iteritems |
| 7 | +from six import with_metaclass |
8 | 8 | from six.moves import queue |
9 | 9 |
|
10 | 10 | from reportportal_client import ReportPortalServiceAsync |
@@ -107,19 +107,14 @@ def start_pytest_item(self, test_item=None): |
107 | 107 | 'request_body=%s', start_rq) |
108 | 108 | self.RP.start_test_item(**start_rq) |
109 | 109 |
|
110 | | - def _get_tags(self, test_item): |
| 110 | + def _get_tags(self, item): |
111 | 111 | # try to extract names of @pytest.mark.* decorators used for test item |
112 | 112 | # 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') |
114 | 114 | if not mark_plugin: |
115 | 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] |
| 116 | + return [k for k in item.keywords if item.get_marker(k) is not None |
| 117 | + and k not in self.ignored_tags] |
123 | 118 |
|
124 | 119 | def finish_pytest_item(self, status, issue=None): |
125 | 120 | self._stop_if_necessary() |
|
0 commit comments