Skip to content

Commit 7f1daf5

Browse files
author
Alexander Iljushkin
authored
Merge pull request #42 from s0undt3ch/hotfix/collect-only
Don't launch if `--collect-only` is passed
2 parents 775e6c9 + 4808ea6 commit 7f1daf5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytest_reportportal/plugin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
def pytest_sessionstart(session):
11+
if session.config.getoption('--collect-only', default=False) is True:
12+
return
13+
1114
PyTestService.init_service(
1215
project=session.config.getini('rp_project'),
1316
endpoint=session.config.getini('rp_endpoint'),
@@ -24,7 +27,10 @@ def pytest_sessionstart(session):
2427
)
2528

2629

27-
def pytest_sessionfinish():
30+
def pytest_sessionfinish(session):
31+
if session.config.getoption('--collect-only', default=False) is True:
32+
return
33+
2834
# FixMe: currently method of RP api takes the string parameter
2935
# so it is hardcoded
3036
PyTestService.finish_launch(status='RP_Launch')

0 commit comments

Comments
 (0)