Open rominf opened 2 months ago
@rominf Thank you for opening this issue, and for linking the investigation! We will place this issue on our internal backlog. However, you are also welcome to open a PR, if you would like – we might be able to implement your suggested changes more quickly that way.
Problem Statement
As a Fedora packager I would like to have pytest to not have pin
< 7.0.0
, so thatpython-sentry-sdk
could be tested in Fedora without workarounds. Also,pytest==7.0.0
was released on Feb 4, 2022.All actual Fedora releases contain
pytest>7.0.0
and installing an older version from PyPI during package build for testing is not possible. Thus, I unpinned it. Since some tests fail withpytest>7.0.0
because of the issue inpytest-forked
, I had to find a way how to fix them. Luckily, thanks to this investigation there is a workaround: reorder the tests so that non-forked tests are not last in the file, see patch.Solution Brainstorm
Of course, the best solution would be to fix the issue in
pytest-forked
, however it looks like a hard problem.My suggestions:
CONTRIBUTING.md
about this quirk. Another option is to add a linter that would inform about the need to reorder tests.