Skip to content

fix: report valid color lookup values clearly - #138

Open
RoboX2020 wants to merge 2 commits into
petercorke:mainfrom
RoboX2020:fix/color-lookup-errors
Open

RoboX2020 wants to merge 2 commits into
petercorke:mainfrom
RoboX2020:fix/color-lookup-errors

Conversation

@RoboX2020

Copy link
Copy Markdown

Addresses the color.py lookup-message part of #115.

The white-point and primary-name lookups now catch KeyError rather than every exception. Their ValueError messages list the supported names with commas, instead of using the entire sentence as a separator. The original KeyError remains available as the cause.

Added two regression tests checking the exact messages and exception causes. Both tests fail against the original implementation.

Validation on Python 3.11 / OpenCV 5.0.0.93:

  • Full pytest suite: 961 passed, 97 skipped, 5 subtests passed.
  • Color tests: 14 passed, 1 skipped.
  • New test file passes ruff and black; changed source passes black.

OpenCV 4 was not run for this PR. The other exception sites in #115 are left unchanged.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant