Skip to content

Enable image comparison by default #223

Description

@bersbersbers

I am used to typing pytest, so I often forget --mpl. Similarly, VS Code's testing pane does not add --mpl and makes test pass falsely.

I have been looking for a way to enable image comparison by default, yet without success.

  • I have read https://pytest-mpl.readthedocs.io/en/stable/configuration.html#enable-testing, which has nothing.
  • I have tried adding pytest_plugins = ("pytest_mpl.plugin",) to conftest.py, but I am getting ValueError: Plugin already registered under a different name: pytest_mpl.plugin=<module 'pytest_mpl.plugin' from 'C:\\ws\\project\\.venv\\Lib\\site-packages\\pytest_mpl\\plugin.py'>
  • I have looked into how pytest parses command-line arguments, but I haven't found a way to inject anything there.
  • I have tried adding import sys; sys.argv = [*sys.argv, "--mpl"] to conftest.py.

How can I force --mpl? (Why does it have to be passed anyway?)

Activity

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