matplotlib / matplotlib/pytest-mpl

decorator hash_library kwarg option precedence

Open
#154 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
272
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Within the plugin.ImageComparison.compare_image_to_hash_library method, should it not be the case that the mpl_image_compare marker hash_library kwarg option should have precedence over the --mpl-hash-library CLI argument?

https://github.com/matplotlib/pytest-mpl/blob/e3876180847c2d04aeda1982372074998a7f8716/pytest_mpl/plugin.py#L520-L521

At the moment this isn't the case, however a similar precedence is supported for the baseline_dir decorator option e.g.,

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pytest_mpl/plugin.py at the compare_image_to_hash_library method around lines 520-521, and trace how the decorator hash_library option and --mpl-hash-library argument are selected. Done means the decorator option takes precedence, consistently with the existing baseline_dir behavior, with regression coverage for that precedence.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.