Is there a way to opt out of PytestReturnNotNoneWarning ?
See original GitHub issueAs of pytest 7.2.0 , any test function that returns something not a None now gets a PytestReturnNotNoneWarning. Looking at its memo in https://github.com/pytest-dev/pytest/blob/main/doc/en/deprecations.rst , I do not see a way to tell pytest, âItâs okay, this return is intentional, just let it return stuff and not emit the warning.â
How do I opt out of this warning?
Whatâs the problem this feature will solve?
This will let me keep using https://github.com/matplotlib/pytest-mpl plugin because it requires returning the Matplotlib figure object for image comparison.
Describe the solution youâd like
Let me opt out.
Alternative Solutions
Tell https://github.com/matplotlib/pytest-mpl devs how to rework their plugin to not return stuff.
Additional context
https://github.com/astropy/astropy/pull/13892 (we do not want to pin maxversion of pytest if we can help it)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
Okay. I also asked at https://github.com/matplotlib/pytest-mpl/issues/183 đ¤
Nope it wonât, thatâs why I said âpytest-mpl probably needs to be updatedâ.