Open yurivict opened 8 months ago
The minimal reproduction is:
# test_it.py
import pytest
pytest.skip("skipping cli test (deps not installed)", allow_module_level=True)
# conftest.py
import pytest
def pytest_collectstart(collector):
if type(collector) is pytest.Module:
collector.obj
In your case the plugin is pytest-asyncio, not a conftest.
The collector.obj
causes the module to be imported and the Skipped
exception to be raised. But pytest only handles Skipped
exceptions from collect()
, not earlier.
I think this is something that can be improved in pytest, but it seems that a workaround was already added to pytest-asyncio: https://github.com/pytest-dev/pytest-asyncio/pull/702. So if you update pytest-asyncio the problem should be fixed.
Pytest fails with the
INTERNALERROR
like in the log below on many projects. Pytest also succeeds on other projects.What is wrong?
Version: 2.5.2 Python-3.9 FreeBSD 14.0