Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added real_adapter_send parameter to RequestsMock #671

Merged
merged 5 commits into from
Oct 4, 2023

Conversation

beliaev-maksim
Copy link
Collaborator

closes #670

allow to explicitly specify real send for each of the request mocks. That will unblock moto and allow moto users to use both responses and moto at the same time

…ow users to set

  through which function they would like to send real requests

* moved type annotations behind IF statement so they are called only during type checking
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
responses/__init__.py 100.00% <100.00%> (ø)
responses/tests/test_responses.py 99.80% <100.00%> (-0.20%) ⬇️

📢 Thoughts on this report? Let us know!.

Copy link

@Seluj78 Seluj78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some documentation about this and moto ?

@beliaev-maksim
Copy link
Collaborator Author

@Seluj78 only if on moto side

@Seluj78
Copy link

Seluj78 commented Oct 3, 2023

I don't understand your last reply but my thought was that there should be some documentation on responses and/or moto that explains the possible problems of using them both and a potential solution (with _real_send) instead of people making issues and searching for hours (like I did 👀)

@bblommers
Copy link
Contributor

There will be documentation on Moto's side, after this is released.

@@ -1008,7 +1023,7 @@ def _on_request(
*,
retries: Optional["_Retry"] = None,
**kwargs: Any,
) -> "models.Response":
) -> "Union[models.Response, models.Response]":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this union have two of the same thing?

@markstory markstory merged commit 0f54001 into getsentry:master Oct 4, 2023
15 of 16 checks passed
@beliaev-maksim beliaev-maksim deleted the mbeliaev/real_send branch October 4, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RecursionError with passthru and _real_send override
4 participants