As 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
astropy/astropy#13892 (we do not want to pin maxversion of pytest if we can help it)
As of pytest 7.2.0 , any test function that returns something not a
Nonenow gets aPytestReturnNotNoneWarning. Looking at its memo in https://github.com/pytest-dev/pytest/blob/main/doc/en/deprecations.rst , I do not see a way to tellpytest, "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
astropy/astropy#13892 (we do not want to pin maxversion of pytest if we can help it)