Skip to content

Commit 3fbadbc

Browse files
committed
Add ignore ssl rules
1 parent c5789e6 commit 3fbadbc

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The following parameters are optional:
6868
- :code:`rp_hierarchy_class = True` - Enables hierarchy for class, default `True`. Doesn't support 'xdist' plugin.
6969
- :code:`rp_hierarchy_parametrize = True` - Enables hierarchy parametrized tests, default `False`. Doesn't support 'xdist' plugin.
7070
- :code:`rp_hierarchy_dirs_level = 0` - Directory starting hierarchy level (from pytest.ini level) (default `0`)
71+
- :code:`rp_ignore_ssl = False` - Ignore SSL Errors when connecting to the server
7172

7273

7374
Examples

pytest_reportportal/plugin.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def pytest_sessionstart(session):
4646
if not session.config.option.rp_enabled:
4747
return
4848

49+
verify_ssl = not session.config.getini('rp_ignore_ssl')
50+
4951
if is_master(session.config):
5052
session.config.py_test_service.init_service(
5153
project=session.config.getini('rp_project'),
@@ -54,6 +56,7 @@ def pytest_sessionstart(session):
5456
log_batch_size=int(session.config.getini('rp_log_batch_size')),
5557
ignore_errors=bool(session.config.getini('rp_ignore_errors')),
5658
ignored_tags=session.config.getini('rp_ignore_tags'),
59+
verify_ssl=verify_ssl
5760
)
5861

5962
session.config.py_test_service.start_launch(
@@ -279,3 +282,9 @@ def pytest_addoption(parser):
279282
default=False,
280283
type='bool',
281284
help='Enables hierarchy for parametrized tests')
285+
286+
parser.addini(
287+
'rp_ignore_ssl',
288+
default=False,
289+
type='bool',
290+
help='Ignores ssl errors')

pytest_reportportal/service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self):
7777
self._item_parts = {}
7878

7979
def init_service(self, endpoint, project, uuid, log_batch_size,
80-
ignore_errors, ignored_tags):
80+
ignore_errors, ignored_tags, verify_ssl=True):
8181
self._errors = queue.Queue()
8282
if self.RP is None:
8383
self.ignore_errors = ignore_errors
@@ -92,7 +92,8 @@ def init_service(self, endpoint, project, uuid, log_batch_size,
9292
project=project,
9393
token=uuid,
9494
error_handler=self.async_error_handler,
95-
log_batch_size=log_batch_size
95+
log_batch_size=log_batch_size,
96+
verify_ssl=verify_ssl
9697
)
9798
else:
9899
log.debug('The pytest is already initialized')

0 commit comments

Comments
 (0)