matplotlib / matplotlib/pytest-mpl

result_image redundancy

Open
#153 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
272
Forks
53
PR merge metrics
No merged PRs in 30d

Description

In the `plugin.ImageComparison.compare_image_to_hash_library` method, during `hybrid-mode`, the `result_image` appears to be unnecessarily copied into the `summary` dictionary from the outcome of `plugin.ImageComparison.compare_image_to_baseline`:

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

i.e., the `summary['result_image']` has already been correctly set within `plugin.ImageComparison.compare_image_to_hash`:

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

If this is the case, are you happy for me to remove this behaviour?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in pytest_mpl/plugin.py at ImageComparison.compare_image_to_hash_library and compare_image_to_baseline, especially the referenced lines around 551-554 and 571-573. Confirm how hybrid-mode populates summary['result_image'], then remove only the redundant behavior if the earlier assignment is sufficient and verify image-comparison behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.