Skip to content

Commit 16135d9

Browse files
authored
tests fix: add PYWB_NO_VERIFY_SSL env var for tests to avoid failing tests when connecting to external services (#760)
- if variable is set, RemoteIndexSource loading does not verify certs
1 parent 1249b41 commit 16135d9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pywb/warcserver/index/indexsource.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
import re
2424
import logging
25+
import os
26+
27+
28+
no_verify = os.environ.get("PYWB_NO_VERIFY_SSL")
2529

2630

2731
#=============================================================================
@@ -46,6 +50,8 @@ def _init_sesh(self, adapter=None):
4650
self.sesh = requests.Session()
4751
self.sesh.mount('http://', adapter)
4852
self.sesh.mount('https://', adapter)
53+
if no_verify:
54+
self.sesh.verify = False
4955

5056

5157
#=============================================================================

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ python =
1212
3.7: py37
1313
3.8: py38
1414
3.9: py39
15-
3.10: py39
15+
3.10: py310
1616

1717
[testenv]
18+
setenv = PYWB_NO_VERIFY_SSL = 1
1819
deps =
1920
-rtest_requirements.txt
2021
-rrequirements.txt

0 commit comments

Comments
 (0)