Add additional `stringify_annotation` tests (#11027)

This commit is contained in:
Christoph Hasse
2023-07-28 06:45:20 +01:00
committed by GitHub
parent d779a1c53e
commit fca33a203d
+3
View File
@@ -446,6 +446,9 @@ def test_stringify_type_union_operator():
assert stringify_annotation(int | str | None) == "int | str | None" # type: ignore
assert stringify_annotation(int | str | None, "smart") == "int | str | None" # type: ignore
assert stringify_annotation(int | Struct) == "int | struct.Struct" # type: ignore
assert stringify_annotation(int | Struct, "smart") == "int | ~struct.Struct" # type: ignore
def test_stringify_broken_type_hints():
assert stringify_annotation(BrokenType, 'fully-qualified-except-typing') == 'tests.test_util_typing.BrokenType'