Skip to content

Commit 264e3cf

Browse files
committed
add test with urllib3
1 parent 4524eff commit 264e3cf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_httpbin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pytest
77
import requests.exceptions
8+
import urllib3
89

910
import pytest_httpbin.certs
1011

@@ -75,3 +76,13 @@ def test_with_urllib2(httpbin_secure):
7576
context = ssl.create_default_context(cafile=pytest_httpbin.certs.where())
7677
with urllib.request.urlopen(url, context=context) as response:
7778
assert response.getcode() == 200
79+
80+
81+
def test_with_urllib3(httpbin_secure):
82+
with urllib3.PoolManager(
83+
cert_reqs="CERT_REQUIRED",
84+
ca_certs=pytest_httpbin.certs.where(),
85+
) as pool:
86+
pool.request(
87+
"POST", httpbin_secure.url + "/post", {"key1": "value1", "key2": "value2"}
88+
)

0 commit comments

Comments
 (0)