You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pytest 8.4 pytest.PytestReturnNotNoneWarning is now an exception #241
The recent release of pytest 8.4 has begun to cause failures in the pytest_mpl tests in the networkx test suite (networkx/networkx#8090).
AIUI, the crux of the problem is that pytest now raises whenever a test returns a non-None value, which conflicts with the design of the mpl_image_compare mark. See also pytest-dev/pytest#13477 for further context/links/discussion.
Thanks @rossbar for letting us know that this warning is now an exception. There are some more details in this section of the docs, but basically when pytest-mpl is installed it'll always intercept any returned figures and prevent this exception from being raised. Alternatively the tests could be skipped. (See also #183)
Activity
ConorMacBride commentedon Jun 3, 2025
Thanks @rossbar for letting us know that this warning is now an exception. There are some more details in this section of the docs, but basically when pytest-mpl is installed it'll always intercept any returned figures and prevent this exception from being raised. Alternatively the tests could be skipped. (See also #183)
ConorMacBride commentedon Jun 30, 2025
Closing as this behavior has now been reverted in Pytest 8.4.1 pytest-dev/pytest#13495