Skip to content

Commit b5bd9b8

Browse files
author
Yury Krasouski
authored
Merge pull request #50 from KKoukiou/description-cli
Add rp-launch-description cli parameter same as exists for ini-options
2 parents 5498b3e + cf193f1 commit b5bd9b8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ The following parameters are optional:
5656
- :code:`rp_launch = AnyLaunchName` - launch name (could be overridden
5757
by pytest --rp-launch option, default value is 'Pytest Launch')
5858
- :code:`rp_launch_tags = 'PyTest' 'Smoke'` - list of tags
59-
- :code:`rp_launch_description = 'Smoke test'` - launch description
59+
- :code:`rp_launch_description = 'Smoke test'` - launch description (could be overridden
60+
by pytest --rp-launch-description option, default value is '')
61+
6062
- :code:`rp_log_batch_size = 20` - size of batch log request
6163
- :code:`rp_ignore_errors = True` - Ignore Report Portal errors (exit otherwise)
6264
- :code:`rp_ignore_tags = 'xfail' 'usefixture'` - Ignore specified pytest markers

pytest_reportportal/plugin.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def pytest_sessionstart(session):
3030
PyTestService.start_launch(
3131
session.config.option.rp_launch,
3232
tags=session.config.getini('rp_launch_tags'),
33-
description=session.config.getini('rp_launch_description'),
33+
description=session.config.option.rp_launch_description,
3434
)
3535

3636

@@ -46,6 +46,8 @@ def pytest_sessionfinish(session):
4646
def pytest_configure(config):
4747
if not config.option.rp_launch:
4848
config.option.rp_launch = config.getini('rp_launch')
49+
if not config.option.rp_launch_description:
50+
config.option.rp_launch_description = config.getini('rp_launch_description')
4951

5052
if config.pluginmanager.hasplugin('xdist'):
5153
raise Exception(
@@ -86,6 +88,11 @@ def pytest_addoption(parser):
8688
action='store',
8789
dest='rp_launch',
8890
help='Launch name (overrides rp_launch config option)')
91+
group.addoption(
92+
'--rp-launch-description',
93+
action='store',
94+
dest='rp_launch_description',
95+
help='Launch description (overrides rp_launch_description config option)')
8996

9097
if PYTEST_HAS_LOGGING_PLUGIN:
9198
group.addoption(

0 commit comments

Comments
 (0)