(obj, expected_type, expected_type_str)
| 2671 | MyClass.__annotations__ = {"attribute": type_} |
| 2672 | |
| 2673 | def check_annotations(obj, expected_type, expected_type_str): |
| 2674 | # On Python 3.14, it's no longer possible to access class |
| 2675 | # annotations from an instance, so use type(). |
| 2676 | assert type(obj).__annotations__["attribute"] == expected_type |
| 2677 | assert obj.method.__annotations__["arg"] == expected_type |
| 2678 | assert obj.method.__annotations__["return"] == expected_type |
| 2679 | return "ok" |
| 2680 | |
| 2681 | obj = MyClass() |
| 2682 | assert check_annotations(obj, type_, "type_") == "ok" |
nothing calls this directly
no outgoing calls
no test coverage detected