Skip to content

Commit ac6a9ff

Browse files
authored
Merge pull request #141 from dmpe/patch-1
disable SSL Verification
2 parents 634bbd9 + aaf78b5 commit ac6a9ff

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pytest_slack/plugin.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
def pytest_addoption(parser):
88
group = parser.getgroup('slack')
9+
group.addoption(
10+
'--ssl_verify',
11+
action='store',
12+
dest='ssl_verify',
13+
default=True,
14+
help='Set the TLS certificate verification'
15+
)
916
group.addoption(
1017
'--slack_channel',
1118
action='store',
@@ -95,7 +102,8 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
95102
report_link = config.option.slack_report_link
96103
slack_hook = config.option.slack_hook
97104
channel = config.option.slack_channel
98-
105+
ssl_verify = config.option.ssl_verify
106+
99107
slack_username = config.option.slack_username if config.option.slack_username else 'Regression testing results'
100108

101109
if int(exitstatus) == 0:
@@ -127,4 +135,4 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
127135
"icon_emoji": emoji if icon is None else None,
128136
"icon_url": icon}
129137

130-
requests.post(slack_hook, data=json.dumps(payload), timeout=timeout)
138+
requests.post(slack_hook, data=json.dumps(payload), timeout=timeout, verify=ssl_verify)

0 commit comments

Comments
 (0)