Skip to content

Improve colorsys coverage#153982

Merged
tomasr8 merged 2 commits into
python:mainfrom
MonadChains:improve-colorsys-coverage
Jul 19, 2026
Merged

Improve colorsys coverage#153982
tomasr8 merged 2 commits into
python:mainfrom
MonadChains:improve-colorsys-coverage

Conversation

@MonadChains

Copy link
Copy Markdown
Contributor

The changes improve the test coverage and robustness of the colorsys module.
They add an extra test to ensure that HSV to RGB remains constant in the case of a 360° phase shift of the Hue.
Additionally, it tests the clamping fallback in the case of YIQ to RGB conversion.

Comment thread Lib/test/test_colorsys.py

@tomasr8 tomasr8 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MonadChains !

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint Jul 18, 2026
@tomasr8 tomasr8 added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 18, 2026
Comment thread Lib/test/test_colorsys.py
((0.0, 0.0, 1.0), (0.0, -1.0, 0.5))
]

for (rgb, yiq) in values:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use unittest.subTest(the support decorator instead is fine, too) here, see the documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, please have a look

@tomasr8
tomasr8 merged commit 54b00c0 into python:main Jul 19, 2026
48 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint Jul 19, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @MonadChains for the PR, and @tomasr8 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154076 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 19, 2026
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154077 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 19, 2026
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154078 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 19, 2026
@tomasr8

tomasr8 commented Jul 19, 2026

Copy link
Copy Markdown
Member

Thank you @MonadChains !

tomasr8 pushed a commit that referenced this pull request Jul 19, 2026
Improve colorsys coverage (GH-153982)

* improve colorsys coverage

* add subtest
(cherry picked from commit 54b00c0)

Co-authored-by: MonadChains <monadchains@gmail.com>
tomasr8 pushed a commit that referenced this pull request Jul 19, 2026
Improve colorsys coverage (GH-153982)

* improve colorsys coverage

* add subtest
(cherry picked from commit 54b00c0)

Co-authored-by: MonadChains <monadchains@gmail.com>
tomasr8 pushed a commit that referenced this pull request Jul 19, 2026
Improve colorsys coverage (GH-153982)

* improve colorsys coverage

* add subtest
(cherry picked from commit 54b00c0)

Co-authored-by: MonadChains <monadchains@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants