Add additional `stringify_annotation` tests (#11027)

This commit is contained in:
Christoph Hasse 2023-07-28 01:45:20 -04:00 committed by GitHub
parent d779a1c53e
commit fca33a203d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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'