Skip to content
Myr

oops! import Timeout as Urllib3Timeout

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alexander 'Leo' Bergolth · committed by Alexander 'Leo' Bergolth · parent 28768b9 · Browse files · 1 file+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−5 removed

  • tests:+5 added−5 removed

1 file+5 added−5 removed

modified:tests/test_requests.py+5 added-5 removed
31 unmodified lines
32from requests.hooks import default_hooks3334from .compat import StringIO, u35from .utils import override_environ36from requests.packages.urllib3.util import Timeout36from requests.packages.urllib3.util import Timeout as Urllib3Timeout3738# Requests to this URL should always fail with a connection timeout (nothing39# listening on that port)40TARPIT = 'http://10.255.255.1'
1975 unmodified lines
20162017 @pytest.mark.parametrize(2018 'timeout', (2019 None,2020 Timeout(connect=None, read=None)2020 Urllib3Timeout(connect=None, read=None)2021 ))2022 def test_none_timeout(self, httpbin, timeout):2023 """Check that you can set None as a valid timeout value.2024
8 unmodified lines
20332034 @pytest.mark.parametrize(2035 'timeout', (2036 (None, 0.1),2037 Timeout(connect=None, read=0.1)2037 Urllib3Timeout(connect=None, read=0.1)2038 ))2039 def test_read_timeout(self, httpbin, timeout):2040 try:2041 requests.get(httpbin('delay/10'), timeout=timeout)
3 unmodified lines
20452046 @pytest.mark.parametrize(2047 'timeout', (2048 (0.1, None),2049 Timeout(connect=0.1, read=None)2049 Urllib3Timeout(connect=0.1, read=None)2050 ))2051 def test_connect_timeout(self, timeout):2052 try:2053 requests.get(TARPIT, timeout=timeout)
4 unmodified lines
20582059 @pytest.mark.parametrize(2060 'timeout', (2061 (0.1, 0.1),2062 Timeout(connect=0.1, read=0.1)2062 Urllib3Timeout(connect=0.1, read=0.1)2063 ))2064 def test_total_timeout_connect(self, timeout):2065 try:2066 requests.get(TARPIT, timeout=timeout)
309 unmodified lines