From 3f08639553fd4108248d613450edf4ca3ebeba8e Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Thu, 21 Mar 2019 16:00:36 -0700 Subject: [PATCH] =?UTF-8?q?still=20seeing=20a=20warning=20but=20?= =?UTF-8?q?=F0=9F=A4=B7=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_warcprox.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_warcprox.py b/tests/test_warcprox.py index e1ff80a..18bcf37 100755 --- a/tests/test_warcprox.py +++ b/tests/test_warcprox.py @@ -68,9 +68,6 @@ import certauth.certauth import warcprox import warcprox.main -# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings -import urllib3 -urllib3.disable_warnings() try: import http.client as http_client @@ -97,9 +94,11 @@ logging.basicConfig( stream=sys.stdout, level=logging.TRACE, format='%(asctime)s %(process)d %(levelname)s %(threadName)s ' '%(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s') + +logging.getLogger("urllib3").setLevel(logging.WARN) logging.getLogger("requests.packages.urllib3").setLevel(logging.WARN) -warnings.simplefilter("ignore", category=requests.packages.urllib3.exceptions.InsecureRequestWarning) -warnings.simplefilter("ignore", category=requests.packages.urllib3.exceptions.InsecurePlatformWarning) +import urllib3 ; urllib3.disable_warnings() +import requests.packages.urllib3 ; requests.packages.urllib3.disable_warnings() def wait(callback, timeout=10): start = time.time()