PY-86002 Adjust PyUnnecessaryCastInspectionTest.test okay expected result

`UnsafeUnion[int | str]` is considered a subtype of `str`, so the cast is redundant.


(cherry picked from commit 550a9d55715564492169175c5e20cfbf1ade4b20)

IJ-MR-184619

GitOrigin-RevId: 854131d04308bd97b12ef06cc10a4aa89238c9ef
This commit is contained in:
Mikhail Golubev
2025-12-03 20:58:50 +00:00
committed by intellij-monorepo-bot
parent 3a75cb758c
commit 7c1fa29f39
@@ -52,7 +52,7 @@ from typing import cast
cast(B, C()) # ok
a: int | str
b = cast(str, a) # ok
b = <weak_warning descr="Unnecessary cast; type is already 'str'">cast(str,</weak_warning> a) # ok
""".trimIndent()
)
}