-
Notifications
You must be signed in to change notification settings - Fork 25
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
pytest-memray breaks anyio #119
Comments
It looks pytest-memray/src/pytest_memray/plugin.py Line 213 in 0654e6b
|
Actually, looks like pytest is storing that state on the test function. We probably need to copy the test function's |
@godlygeek thanks for the investigation. |
My original analysis didn't spot the problem, actually. It's not that anyio isn't finding the state it expect on the wrapper, it's that anyio is completely ignoring the wrapper, because it only wants to process coroutine functions and ignore other stuff, and our wrapper isn't a coroutine function (even though calling it does return a coroutine, anyio is specifically looking only for We might be able to get around that by defining an |
This fix was released in pytest-memray 1.7.0 |
Thanks! |
Hola @pablogsal,
I am facing the same issue: the async tests are skipped if we pass
--memray
argument to pytest.Steps to reproduce the issue:
Use the following test file:
test_async.py
Install required dependencies:
The test runs as expected if
--memray
is not passed:Output:
However, the test is skipped if we pass
--memray
:Output:
Originally posted by @albertvillanova in #101 (comment)
The text was updated successfully, but these errors were encountered: