Skip to content

Commit 7366bea

Browse files
authored
Merge branch 'master' into items_sort
2 parents 762678a + e9518ce commit 7366bea

File tree

10 files changed

+258
-216
lines changed

10 files changed

+258
-216
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ stages:
55
language: python
66
python:
77
- "2.7"
8-
- "3.4"
98
- "3.5"
109
- "3.6"
10+
- "3.7"
11+
- "3.8"
1112
script:
1213
- python setup.py test
1314
- python setup.py -q install

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@ Example of :code:`pytest.ini`:
6969
rp_endpoint = http://192.168.1.10:8080
7070
rp_project = user_personal
7171
rp_launch = AnyLaunchName
72-
rp_launch_tags = 'PyTest' 'Smoke'
72+
rp_launch_attributes = 'PyTest' 'Smoke'
7373
rp_launch_description = 'Smoke test'
7474
rp_ignore_errors = True
75-
rp_ignore_tags = 'xfail' 'usefixture'
75+
rp_ignore_attributes = 'xfail' 'usefixture'
7676
7777
The following parameters are optional:
7878

7979
- :code:`rp_launch = AnyLaunchName` - launch name (could be overridden
8080
by pytest --rp-launch option, default value is 'Pytest Launch')
81-
- :code:`rp_launch_tags = 'PyTest' 'Smoke'` - list of tags for launch
82-
- :code:`rp_tests_tags = 'PyTest' 'Smoke'` - list of tags that will be added for each item in the launch
81+
- :code:`rp_launch_attributes = 'PyTest' 'Smoke'` - list of attributes for launch
82+
- :code:`rp_tests_attributes = 'PyTest' 'Smoke'` - list of attributes that will be added for each item in the launch
8383
- :code:`rp_launch_description = 'Smoke test'` - launch description (could be overridden
8484
by pytest --rp-launch-description option, default value is '')
8585

8686
- :code:`rp_log_batch_size = 20` - size of batch log request
8787
- :code:`rp_ignore_errors = True` - Ignore Report Portal errors (exit otherwise)
88-
- :code:`rp_ignore_tags = 'xfail' 'usefixture'` - Ignore specified pytest markers
88+
- :code:`rp_ignore_attributes = 'xfail' 'usefixture'` - Ignore specified pytest markers
8989
- :code:`rp_hierarchy_dirs = True` - Enables hierarchy for tests directories, default `False`. Doesn't support 'xdist' plugin.
9090
- :code:`rp_hierarchy_module = True` - Enables hierarchy for module, default `True`. Doesn't support 'xdist' plugin.
9191
- :code:`rp_hierarchy_class = True` - Enables hierarchy for class, default `True`. Doesn't support 'xdist' plugin.
@@ -99,7 +99,7 @@ The following parameters are optional:
9999

100100

101101
If you like to override the above parameters from command line, or from CI environment based on your build, then pass
102-
- :code:`-o "rp_launch_tags=Smoke Tests"` during invocation.
102+
- :code:`-o "rp_launch_attributes=Smoke Tests"` during invocation.
103103

104104
Examples
105105
~~~~~~~~
@@ -174,8 +174,8 @@ Plugin can report doc-strings of tests as :code:`descriptions`:
174174
"""
175175
pass
176176
177-
Pytest markers will be attached as :code:`tags` to Report Portal items.
178-
In the following example tags 'linux' and 'win32' will be used:
177+
Pytest markers will be attached as :code:`attributes` to Report Portal items.
178+
In the following example attributes 'linux' and 'win32' will be used:
179179

180180
.. code-block:: python
181181
@@ -186,7 +186,7 @@ In the following example tags 'linux' and 'win32' will be used:
186186
def test_one():
187187
pass
188188
189-
If you don't want to attach specific markers, list them in :code:`rp_ignore_tags` parameter
189+
If you don't want to attach specific markers, list them in :code:`rp_ignore_attributes` parameter
190190

191191

192192
Launching

pytest_reportportal/listener.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ def __init__(self, py_test_service,
3232

3333
@pytest.hookimpl(hookwrapper=True)
3434
def pytest_runtest_protocol(self, item):
35-
# Adding issues id marks to the test item
36-
# if client doesn't support item updates
37-
update_supported = self.PyTestService.is_item_update_supported()
38-
if not update_supported:
39-
self._add_issue_id_marks(item)
40-
35+
self._add_issue_id_marks(item)
4136
item_id = self.PyTestService.start_pytest_item(item)
4237
if PYTEST_HAS_LOGGING_PLUGIN:
4338
# This check can go away once we support pytest >= 3.3
@@ -47,11 +42,6 @@ def pytest_runtest_protocol(self, item):
4742
yield
4843
else:
4944
yield
50-
# Updating item in RP (tags and description)
51-
# if client supports
52-
if update_supported:
53-
self._add_issue_id_marks(item)
54-
self.PyTestService.update_pytest_item(item)
5545
# Finishing item in RP
5646
self.PyTestService.finish_pytest_item(
5747
item, item_id, self.result or 'SKIPPED', self.issue or None)
@@ -150,7 +140,7 @@ def _add_issue_info(self, item, report):
150140
(issue_type in getattr(self.PyTestService, 'issue_types', ())):
151141
if comment:
152142
self.issue['comment'] = comment
153-
self.issue['issue_type'] = self.PyTestService.issue_types[issue_type]
143+
self.issue['issueType'] = self.PyTestService.issue_types[issue_type]
154144
# self.issue['ignoreAnalyzer'] = True ???
155145
elif (report.when == 'setup') and report.skipped:
156-
self.issue['issue_type'] = 'NOT_ISSUE'
146+
self.issue['issueType'] = 'NOT_ISSUE'

pytest_reportportal/plugin.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ def pytest_sessionstart(session):
5555
uuid=session.config.getini('rp_uuid'),
5656
log_batch_size=int(session.config.getini('rp_log_batch_size')),
5757
ignore_errors=bool(session.config.getini('rp_ignore_errors')),
58-
ignored_tags=session.config.getini('rp_ignore_tags'),
58+
ignored_attributes=session.config.getini('rp_ignore_attributes'),
5959
verify_ssl=session.config.getini('rp_verify_ssl'),
6060
retries=int(session.config.getini('retries')),
6161
)
6262

63+
attributes = [{'value': tag} for tag in
64+
session.config.getini('rp_launch_attributes')]
6365
session.config.py_test_service.start_launch(
6466
session.config.option.rp_launch,
65-
tags=session.config.getini('rp_launch_tags'),
67+
attributes=attributes,
6668
description=session.config.option.rp_launch_description
6769
)
6870
if session.config.pluginmanager.hasplugin('xdist'):
@@ -217,14 +219,14 @@ def pytest_addoption(parser):
217219
help='Launch name')
218220

219221
parser.addini(
220-
'rp_launch_tags',
222+
'rp_launch_attributes',
221223
type='args',
222-
help='Launch tags, i.e Performance Regression')
224+
help='Launch attributes, i.e Performance Regression')
223225

224226
parser.addini(
225-
'rp_tests_tags',
227+
'rp_tests_attributes',
226228
type='args',
227-
help='Tags for all tests items, e.g. Smoke')
229+
help='Attributes for all tests items, e.g. Smoke')
228230

229231
parser.addini(
230232
'rp_launch_description',
@@ -243,7 +245,7 @@ def pytest_addoption(parser):
243245
help='Ignore Report Portal errors (exit otherwise)')
244246

245247
parser.addini(
246-
'rp_ignore_tags',
248+
'rp_ignore_attributes',
247249
type='args',
248250
help='Ignore specified pytest markers, i.e parametrize')
249251

0 commit comments

Comments
 (0)