Skip to content
Myr

Merge remote-tracking branch 'origin/develop' into develop

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parents ccf5504, 1e61cf5 · Browse files · 2 files+7 added−3 removed
This commit

State

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

Diff stats

2 files+7 added−3 removed

  • tests:+4 added−0 removed
  • other:+3 added−3 removed

2 files+7 added−3 removed

modified:requests/models.py+3 added-3 removed
460 unmodified lines
461 return ''.join(url)462463 def register_hook(self, event, hook):464 """Properly register a hook."""465 if isinstance(hook, (list, tuple, set)):466 self.hooks[event].extend(hook)467 else:465 if callable(hook):466 self.hooks[event].append(hook)467 elif hasattr(hook, '__iter__'):468 self.hooks[event].extend(h for h in hook if callable(h))469470 def deregister_hook(self, event, hook):471 """Deregister a previously registered hook.472 Returns True if the hook existed, False if not.
420 unmodified lines
modified:tests/test_requests.py+4 added
776 unmodified lines
777778 r = requests.models.Request(hooks={'args': hooks})779 assert_hooks_are_callable(r.hooks)780781 hooks.append('string that should not be registered')782 r = requests.models.Request(hooks={'args': hooks})783 assert_hooks_are_callable(r.hooks)784785 def test_session_persistent_cookies(self):786787 s = requests.session()788
395 unmodified lines