Asynctest owner suggests switch to asyncmock
See original GitHub issueWhen using the asynctest
package (which is a dependency of respx
) with Python 3.8+, there are deprecation warnings:
.venv/lib/python3.8/site-packages/asynctest/mock.py:448
/Users/.../.venv/lib/python3.8/site-packages/asynctest/mock.py:448: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
def wait_next(self, skip=0):
The author of asynctest suggests moving to asyncmock
instead of resolving the issues (1, 2).
I am wondering if this would be an option for you to make respx
future-proof.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Mocking — asynctest 0.12.3 documentation
As the documentation of unittest says it, create_autospec() creates mock objects that have the same ... It doesn't change the outcome of the...
Read more >Strategies for Testing Async Code in Python - Agari
Discover how to write tests for asyncio codebases in Python, with examples taken from real-world code in Agari Phishing Defense.
Read more >Test and Mock Asynchronous Calls With the Jest Testing ...
This change ensures there will be one expect executed in this test case. Therefore, since no expect is called before exiting, the test...
Read more >How to use the asynctest.mock.patch function in ... - Snyk
To help you get started, we've selected a few asynctest.mock.patch examples, based on popular ways it is used in public projects.
Read more >Patching Async Object in Python 3.8 - Stack Overflow
For testing asyncio code by means of pytest I would suggest you to use libs pytest-asyncio and asynctest.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for testing @hugovk ,
0.12.0
now released.I’ve opened #69 . Since we’re only patching methods and not really using async magic mocks, I was able to drop the
asynctest
dependency completely.