Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable image comparison by default #223

Closed
bersbersbers opened this issue Feb 27, 2024 · 1 comment
Closed

Enable image comparison by default #223

bersbersbers opened this issue Feb 27, 2024 · 1 comment

Comments

@bersbersbers
Copy link

bersbersbers commented Feb 27, 2024

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?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant