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

Support introspection diffs for AsyncMock in Python 3.8 #196

Closed
tirkarthi opened this issue Jul 6, 2020 · 3 comments · Fixed by #197
Closed

Support introspection diffs for AsyncMock in Python 3.8 #196

tirkarthi opened this issue Jul 6, 2020 · 3 comments · Fixed by #197

Comments

@tirkarthi
Copy link
Contributor

Python 3.8 added AsyncMock and added helpers equivalent to other assert helpers like assert_not_awaited, assert_awaited_with, etc. Currently diff support is added for Mocks. I guess it would be good to expand this to AsyncMock so that awaited calls also get better error messages. This would be similar to add to adding assert_wrapper for the helpers and patching the original helpers with this wrapped helpers as it's done now for. This is slightly related to #150 as it needs AsyncMock which is Python 3.8+ and mock 4.0+ to be available and thus the code might need conditionals to accommodate for the relevant versions.

A commit implementing this : https://github.com/tirkarthi/pytest-mock/commit/97b5800eb75360eec3cabf4a26698c787a3609bb

@nicoddemus
Copy link
Member

Thanks for the suggestion @tirkarthi.

That commit seems pretty complete to me at a glance, would you like to open a PR?

@tirkarthi
Copy link
Contributor Author

Sure, created #197.

@nicoddemus
Copy link
Member

Thanks @tirkarthi, 3.2.0 released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants