(self)
| 407 | self.assertEqual(interp.format_spec, "") |
| 408 | |
| 409 | def test_getitem(self): |
| 410 | def f(x: undef1[str, undef2]): |
| 411 | pass |
| 412 | anno = get_annotations(f, format=Format.STRING) |
| 413 | self.assertEqual(anno, {"x": "undef1[str, undef2]"}) |
| 414 | |
| 415 | anno = get_annotations(f, format=Format.FORWARDREF) |
| 416 | fwdref = anno["x"] |
| 417 | self.assertIsInstance(fwdref, ForwardRef) |
| 418 | self.assertEqual( |
| 419 | fwdref.evaluate(globals={"undef1": dict, "undef2": float}), dict[str, float] |
| 420 | ) |
| 421 | |
| 422 | def test_slice(self): |
| 423 | def f(x: a[b:c]): |
nothing calls this directly
no test coverage detected