Added type hints to additional tests by radarhere · Pull Request #8093 · python-pillow/Pillow

Tests/test_imagecms.py:212: error: Argument 1 to "getProfileName" has incompatible type "None"; expected
"Union[str, SupportsRead[bytes], CmsProfile, ImageCmsProfile]"  [arg-type]
            ImageCms.getProfileName(None)
                                    ^~~~

The test's intention is to go through

def getProfileName(profile: _CmsProfileCompatible) -> str:

where

_CmsProfileCompatible = Union[
str, SupportsRead[bytes], core.CmsProfile, ImageCmsProfile
]

and then

class ImageCmsProfile:
def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None:

to reach

msg = "Invalid type for Profile" # type: ignore[unreachable]

The type is deliberately incorrect.