Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions Tests/test_imagecms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import shutil
from io import BytesIO
from pathlib import Path
from typing import Any

import pytest

Expand Down Expand Up @@ -336,25 +337,13 @@ def test_extended_information() -> None:
p = o.profile

def assert_truncated_tuple_equal(
tup1: tuple[tuple[float, float, float], ...] | tuple[float],
tup2: (
tuple[tuple[tuple[float, float, float], ...], ...]
| tuple[tuple[float, float, float], ...]
| tuple[float]
),
digits: int = 10,
tup1: tuple[Any, ...], tup2: tuple[Any, ...], digits: int = 10
) -> None:
# Helper function to reduce precision of tuples of floats
# recursively and then check equality.
power = 10**digits

def truncate_tuple(
tuple_or_float: (
tuple[tuple[tuple[float, float, float], ...], ...]
| tuple[tuple[float, float, float], ...]
| tuple[float, ...]
)
) -> tuple[tuple[float, ...], ...]:
def truncate_tuple(tuple_or_float: tuple[Any, ...]) -> tuple[Any, ...]:
Copy link
Member

Choose a reason for hiding this comment

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

This parameter is called tuple_or_float but typed only as a tuple.

Do we ever call it as a float? If not, shall we rename it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've pushed a commit to rename it to tuple_value.

return tuple(
(
truncate_tuple(val)
Expand Down