You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the traceback, seems like the pytest-asyncio is trying to create a new event lopp before the pytest-mock has a chance to uninstall the mock.
I'm closing because I don't see what can be done on pytest-mock's side to prevent this: we remove the mocks during fixture teardown, which is the straightforward way to handle unmocking here.
Consider these two test cases:
The top case reports
ERROR at teardown of test_mocksocket_mocker
, while the bottom one does not report any error.The error message in full:
It seems like the mocked socket survived while pytest-asyncio is closing the current event loop and creating a new one.
Also, there seems to be a weird interaction with pytest-asyncio. The error disappears if an event_loop fixture is requested, like so:
Attached is the test file, full console output, and package versions. This is running on Windows 10.
https://github.com/pytest-dev/pytest-asyncio/files/15039206/pytest-asyncio-mock.zip
I have also reported this problem to pytest-asyncio: pytest-dev/pytest-asyncio#818
The text was updated successfully, but these errors were encountered: