pytest
pytest copied to clipboard
Reintroduce PytestReturnNotNoneWarning
Since this warning is meant to be permanent, added proper documentation to the assert section in the docs.
Fixes #13477
Do we consider this a bugfix that is OK to enter in the next patch release, or should we wait for 8.5?
We should backport as we correct a regression
I'm getting the same failure on main locally.
Testing main on https://github.com/pytest-dev/pytest/pull/13496 to confirm the failure is unrelated to these changes.
Blocked by https://github.com/pytest-dev/pytest/issues/13497, will wait for us to fix that before merging this.
The related issue is possibly something larger to fix so id prefer we dont block on it
Apologies if this comment is off the mark, but do we need to separately handle the await case (https://github.com/pytest-dev/pytest/issues/11372) that was the original rationale for changing the warning to an error?
If I understand correctly your question, no. The state of affairs will be:
asynctests will always fail if not handled by a plugin.- Normal tests will always generate a warning if they return non-
None.
Backport to 8.4.x: 💚 backport PR created
✅ Backport PR branch: patchback/backports/8.4.x/53f05c44d9530c4ac5ce5804ef75fe61713d46d8/pr-13495
Backported as https://github.com/pytest-dev/pytest/pull/13527
🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.