summaryrefslogtreecommitdiff
path: root/test_requests.py
diff options
context:
space:
mode:
authorcjstapleton <chelsea.j.stapleton@gmail.com>2014-02-28 10:08:57 -0600
committercjstapleton <chelsea.j.stapleton@gmail.com>2014-02-28 10:08:57 -0600
commit930f03c8649613da9efb7915e17428dd1e8526af (patch)
tree08bd8fefc6fbbad9c6c55d44f510eeb1b9ba0206 /test_requests.py
parente909a923431be2597498c33adc57707f0488bc76 (diff)
downloadpython-requests-930f03c8649613da9efb7915e17428dd1e8526af.tar.gz
Add timeout to stream with testing
Fixes Issue #1803
Diffstat (limited to 'test_requests.py')
-rwxr-xr-xtest_requests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test_requests.py b/test_requests.py
index 3d7cdaaf..0fe849d4 100755
--- a/test_requests.py
+++ b/test_requests.py
@@ -1170,6 +1170,15 @@ class TestMorselToCookieMaxAge(unittest.TestCase):
with pytest.raises(TypeError):
morsel_to_cookie(morsel)
+class TestTimeout:
+ def test_stream_timeout(self):
+ try:
+ r = requests.get('https://httpbin.org/delay/10', timeout=5.0)
+ except requests.exceptions.Timeout as e:
+ assert 'Read timed out' in e.args[0].args[0]
+
if __name__ == '__main__':
unittest.main()
+
+