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

fix(pop): expose pop in api #72

Merged
merged 4 commits into from Sep 22, 2020
Merged

Conversation

paulineribeyre
Copy link
Contributor

fixes #70

Copy link
Owner

@lundberg lundberg left a 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:
Copy link
Owner

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.

Copy link
Owner

@lundberg lundberg left a 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
Comment on lines 6 to 7
DefaultType = TypeVar("DefaultType", bound=Any)

Copy link
Owner

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?

Copy link
Owner

@lundberg lundberg left a comment

Choose a reason for hiding this comment

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

🎉

@lundberg lundberg merged commit 8c5fbbc into lundberg:master Sep 22, 2020
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.

module 'respx' has no attribute 'pop'
2 participants