Skip to content
Myr

Revert "[kennethreitz/requests#1208] adding unit test for max_retries"

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

This reverts commit 18b29ea00563a0bf8e15666806117444c87ac23f.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 23d8522 · Browse files · 1 file+0 added−21 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−21 removed

  • other:+0 added−21 removed

1 file+0 added−21 removed

modified:test_requests.py-21 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_urlopen388 389369if __name__ == '__main__':370 unittest.main()