Tests fail with pytest 8.0

#19 · closed · 3 comments

View on GitHub ↗

mgedmin

Compare - [pypy3.9 build with pytest 8.0.0](https://github.com/mgedmin/pyspacewar/actions/runs/7764731415/job/21178549709) - [pypy3.9 build with pytest 7.4.4](https://github.com/mgedmin/pyspacewar/actions/runs/7676523630/job/20924188028) Localy I can reproduce with other Python versions, e.g. CPython 3.12. The symptoms are a bit different on my machine: test_main.py hangs while eating half of a CPU core rather than failing quickly. I hit ^C after a few hundred seconds.

Comments

mgedmin

This is super weird: - `.tox/py312/bin/pytest src/pyspacewar/tests/*.py` passes all 137 tests - `.tox/py312/bin/pytest src/pyspacewar/tests/` collects the same 137 tests and then fails in test_main.py and a bunch afterwards (44 failed, 92 passed, 1 skipped) The failures look like some of my mocks aren't being applied (they're in module-scoped autouse fixtures).

mgedmin

Read the [pytest changelog](https://docs.pytest.org/en/stable/changelog.html#pytest-8-0-0-2024-01-27), failed to see which of the compat-breaking changes I might have stumbled upon. Filed a pytest bug: https://github.com/pytest-dev/pytest/issues/11929

mgedmin

For now I've pinned `pytest < 8` in my test requirements to keep CI green.