1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

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
This commit is contained in:
Ilya Kreymer 2022-08-31 18:30:45 -07:00 committed by GitHub
parent 1249b41dba
commit 16135d956a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,10 @@ import requests
import re
import logging
import os
no_verify = os.environ.get("PYWB_NO_VERIFY_SSL")
#=============================================================================
@ -46,6 +50,8 @@ class BaseIndexSource(object):
self.sesh = requests.Session()
self.sesh.mount('http://', adapter)
self.sesh.mount('https://', adapter)
if no_verify:
self.sesh.verify = False
#=============================================================================

View File

@ -12,9 +12,10 @@ python =
3.7: py37
3.8: py38
3.9: py39
3.10: py39
3.10: py310
[testenv]
setenv = PYWB_NO_VERIFY_SSL = 1
deps =
-rtest_requirements.txt
-rrequirements.txt