Closed MetRonnie closed 2 years ago
@MetRonnie After a brief look at
pytest-tornasync
it seems the plugin has a similar behaviour topytest-asyncio
withasync_mode=auto
: It tries to run all tests that are coroutines in atornado.IoLoop
. When both plugins try to do the same thing, unexpected things happen.If your project is using both
pytest-asyncio
andpytest-tornasync
, you should stick withasyncio_mode=strict
.
https://github.com/pytest-dev/pytest-asyncio/issues/257#issuecomment-1017566870
However, seeing as the project does not have pytest-tornasync
as a dependency, we were instead able to do
def pytest_addhooks(pluginmanager):
pluginmanager.unregister('tornado')
in conftest.py
.
Update: that conftest fix doesn't actually seem to work, instead this works in pytest.ini
:
[pytest]
addopts =
-p no:tornado
When running tests in a project that doesn't have pytest-tornasync as a dependency, with pytest-asyncio 0.17.2 and
asyncio_mode = auto
inpytest.ini
, I get failures after removing@pytest.mark.asyncio
decorators from my tests.