From 795e0acda7d46fdb82623cc6fbe5eb0c530606ad Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Mon, 2 Aug 2021 18:09:34 +0200 Subject: [PATCH] ci: remove InsecureRequestWarning from urllib3 --- test/test_headers/test_https.py | 6 +++++- .../wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_headers/test_https.py b/test/test_headers/test_https.py index 9aa967a..c5457c4 100644 --- a/test/test_headers/test_https.py +++ b/test/test_headers/test_https.py @@ -1,3 +1,6 @@ +import pytest + + def test_arbitrary_headers_are_passed_on(docker_compose, nginxproxy): r = nginxproxy.get("https://web.nginx-proxy.tld/headers", headers={'Foo': 'Bar'}) assert r.status_code == 200 @@ -78,6 +81,7 @@ def test_httpoxy_safe(docker_compose, nginxproxy): assert "Proxy:" not in r.text +@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning') def test_no_host_server_tokens_off(docker_compose, nginxproxy): ip = nginxproxy.get_ip() r = nginxproxy.get(f"https://{ip}/headers", verify=False) @@ -86,7 +90,7 @@ def test_no_host_server_tokens_off(docker_compose, nginxproxy): def test_server_tokens_on(docker_compose, nginxproxy): - r = nginxproxy.get("https://web.nginx-proxy.tld/headers", verify=False) + r = nginxproxy.get("https://web.nginx-proxy.tld/headers") assert r.status_code == 200 assert "Host: web.nginx-proxy.tld" in r.text assert r.headers["Server"].startswith("nginx/") diff --git a/test/test_ssl/wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py b/test/test_ssl/wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py index 03af625..68b0329 100644 --- a/test/test_ssl/wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py +++ b/test/test_ssl/wildcard_cert_and_nohttps/test_wildcard_cert_nohttps.py @@ -23,7 +23,7 @@ def test_https_get_served(docker_compose, nginxproxy, subdomain): assert r.status_code == 200 assert f"answer from port 8{subdomain}\n" == r.text - +@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning') def test_web3_https_is_500_and_SSL_validation_fails(docker_compose, nginxproxy): with pytest.raises( (CertificateError, SSLError) ) as excinfo: nginxproxy.get("https://3.web.nginx-proxy.tld/port")