-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix(pop): expose pop in api #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I've linted master with the latest black
version, so please rebase and drop your black commit so that this PR only contains changes regarding the issue.
respx/api.py
Outdated
@@ -30,6 +30,11 @@ def reset() -> None: | |||
mock.reset() | |||
|
|||
|
|||
def pop(alias: Optional[str] = None) -> RequestPattern: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see this global pop
to expose the same functionality as the one(s) on the transport, i.e. alias
should not be optional and a default should be allowed.
Also, the overloading would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
respx/api.py
Outdated
DefaultType = TypeVar("DefaultType", bound=Any) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor, maybe this DefaultType
could be moved to models.py
, to be used both in api and transports modules, instead of duplicating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
fixes #70