Skip to content

Pytest 8.4 pytest.PytestReturnNotNoneWarning is now an exception #241

Closed

Description

@rossbar

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.

Activity

  1. ConorMacBride commented on Jun 3, 2025

    @ConorMacBride
    Member

    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)

  2. ConorMacBride commented on Jun 30, 2025

    @ConorMacBride
    Member

    Closing as this behavior has now been reverted in Pytest 8.4.1 pytest-dev/pytest#13495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions