Skip to content
Myr

highway to the danger_mode

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

authored by Bryan Helmig · committed by Bryan Helmig · parent 115b51e · Browse files · 3 files+4 added−4 removed
This commit

State

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

Diff stats

3 files+4 added−4 removed

  • other:+4 added−4 removed

3 files+4 added−4 removed

modified:requests/defaults.py+2 added-2 removed
13 unmodified lines
14:max_redirects: Maximum number of redirects allowed within a request.15:decode_unicode: Decode unicode responses automatically?16:keep_alive: Reuse HTTP Connections?17:max_retries: The number of times a request should be retried in the event of a connection failure.18:eager_mode: If true, Requests will raise errors immediately.18:danger_mode: If true, Requests will raise errors immediately.19:safe_mode: If true, Requests will catch all errors.20:pool_maxsize: The maximium size of an HTTP connection pool.21:pool_connections: The number of active HTTP connection pools to use.22
15 unmodified lines
38defaults['decode_unicode'] = True39defaults['pool_connections'] = 1040defaults['pool_maxsize'] = 1041defaults['max_retries'] = 042defaults['eager_mode'] = False42defaults['danger_mode'] = False43defaults['safe_mode'] = False44defaults['keep_alive'] = True
modified:requests/models.py+1 added-1 removed
524 unmodified lines
525 if prefetch:526 # Save the response.527 self.response.content528 529 if self.config.get('eager_mode'):529 if self.config.get('danger_mode'):530 self.response.raise_for_status()531532 return self.sent533
184 unmodified lines
modified:test_requests.py+1 added-1 removed
278 unmodified lines
279 r.raise_for_status()280281282 def test_default_status_raising(self):283 config = {'eager_mode': True}283 config = {'danger_mode': True}284 args = [httpbin('status', '404')]285 kwargs = dict(config=config)286 self.assertRaises(HTTPError, requests.get, *args, **kwargs)287
371 unmodified lines