(self)
| 8246 | self.assertEqual(Z.__annotate__(annotationlib.Format.STRING), {"a": "None", "b": "str"}) |
| 8247 | |
| 8248 | def test_future_annotations(self): |
| 8249 | code = """ |
| 8250 | from __future__ import annotations |
| 8251 | from typing import NamedTuple |
| 8252 | class X(NamedTuple): |
| 8253 | a: int |
| 8254 | b: None |
| 8255 | """ |
| 8256 | ns = run_code(textwrap.dedent(code)) |
| 8257 | X = ns['X'] |
| 8258 | self.assertEqual(X.__annotations__, {'a': EqualToForwardRef("int"), 'b': EqualToForwardRef("None")}) |
| 8259 | |
| 8260 | def test_deferred_annotations(self): |
| 8261 | class X(NamedTuple): |
nothing calls this directly
no test coverage detected