Skip to content
Myr

cleanup (remove max_retries test)

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

authored by Piotr Staroszczyk · committed by Piotr Staroszczyk · parent 13de692 · Browse files · 1 file+0 added−20 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+0 added−20 removed

  • other:+0 added−20 removed

1 file+0 added−20 removed

modified:test_requests.py-20 removed
364 unmodified lines
365 def test_cannot_send_unprepared_requests(self):366 r = requests.Request(url=HTTPBIN)367 self.assertRaises(ValueError, requests.Session().send, r)368369 def test_can_specify_retries(self):370 # monkey patch urlopen371 from requests.packages.urllib3.poolmanager import HTTPConnectionPool372 old_urlopen = HTTPConnectionPool.urlopen373374 max_retries_used = []375 def urlopen(*args, **kwargs):376 """Save what value we used for retries each time we call urlopen."""377 max_retries_used.append(kwargs.get('retries'))378 return old_urlopen(*args, **kwargs)379380 HTTPConnectionPool.urlopen = urlopen381382 # do the request and check that max_retries was passed through383 requests.get(httpbin('get'), max_retries=5)384 self.assertEqual(max_retries_used, [5])385386 # undo monkey patch387 HTTPConnectionPool.urlopen = old_urlopen388369 def test_http_error(self):370 error = requests.exceptions.HTTPError()371 self.assertEqual(error.response, None)372 response = requests.Response()
9 unmodified lines