Skip to content

Commit

Permalink
Shorten line length of comments
Browse files Browse the repository at this point in the history
This was recently indented another level which caused the test to fail
and block PRs
  • Loading branch information
jamielennox committed Apr 20, 2022
1 parent 0aeaecd commit e0d3108
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions requests_mock/mocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,16 @@ def _fake_send(session, request, **kwargs):
# mock get_adapter
_set_method(session, "get_adapter", _fake_get_adapter)

# NOTE(jamielennox): self._last_send vs _original_send. Whilst it
# seems like here we would use _last_send there is the possibility
# that the user has messed up and is somehow nesting their mockers.
# If we call last_send at this point then we end up calling this
# function again and the outer level adapter ends up winning.
# All we really care about here is that our adapter is in place
# before calling send so we always jump directly to the real
# function so that our most recently patched send call ends up
# putting in the most recent adapter. It feels funny, but it works.
# NOTE(jamielennox): self._last_send vs _original_send. Whilst
# it seems like here we would use _last_send there is the
# possibility that the user has messed up and is somehow
# nesting their mockers. If we call last_send at this point
# then we end up calling this function again and the outer
# level adapter ends up winning. All we really care about here
# is that our adapter is in place before calling send so we
# always jump directly to the real function so that our most
# recently patched send call ends up putting in the most recent
# adapter. It feels funny, but it works.

try:
return _original_send(session, request, **kwargs)
Expand Down

0 comments on commit e0d3108

Please sign in to comment.