Skip to content

Commit

Permalink
Fix test to handle urllib3 1.x and 2.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonyl committed May 8, 2023
1 parent 7f93bbf commit afb2cc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import sys

import pytest
import requests
from requests.auth import HTTPProxyAuth
Expand Down Expand Up @@ -122,7 +124,7 @@ class TestRequests(object):

def test_proxy_connect_timeout(self):
session = requests.Session()
with pytest.raises(ConnectTimeout):
with pytest.raises((ProxyError, ConnectTimeout)): # ConnectTimeout on urllib3 < 2
session.get(arbitrary_url, timeout=1, proxies=proxy_parameter_for_requests("http://httpbin.org:99"))

def test_proxy_response_timeout(self):
Expand Down

0 comments on commit afb2cc9

Please sign in to comment.