Skip to content

Commit

Permalink
Fix test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Dec 5, 2024
1 parent 7c57780 commit 74b619b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion coloraide/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def average(
if out_space is None:
out_space = space

if powerless is not None:
if powerless is not None: # pragma: no cover
warn_deprecated("The use of 'powerless' with 'average()' is deprecated as it is now always enabled")

return average.average(
Expand Down
13 changes: 13 additions & 0 deletions tests/test_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ def test_average_ignore_undefined(self):
'color(srgb 0 0.19608 0.33333)']
)

def test_average_with_undefined_alpha_result(self):
"""Test average when the resulting alpha is undefined."""

colors = [
Color('color(srgb 1 1 0 / none)'),
Color('color(srgb 0 0.50196 0 / none)'),
Color('color(srgb 0 0 1 / none)')
]
self.assertEqual(
Color.average(colors, space='srgb').to_string(color=True, none=True),
'color(srgb 0.33333 0.50065 0.33333 / none)'
)

def test_average_ignore_undefined_alpha_premultiplied(self):
"""Test averaging ignores undefined."""

Expand Down

0 comments on commit 74b619b

Please sign in to comment.