(self)
| 100 | self.assertEqual(fwdref, x[y]) |
| 101 | |
| 102 | def test_function(self): |
| 103 | def f(x: int, y: doesntexist): |
| 104 | pass |
| 105 | |
| 106 | anno = get_annotations(f, format=Format.FORWARDREF) |
| 107 | self.assertIs(anno["x"], int) |
| 108 | fwdref = anno["y"] |
| 109 | self.assertIsInstance(fwdref, ForwardRef) |
| 110 | self.assertEqual(fwdref.__forward_arg__, "doesntexist") |
| 111 | with self.assertRaises(NameError): |
| 112 | fwdref.evaluate() |
| 113 | self.assertEqual(fwdref.evaluate(globals={"doesntexist": 1}), 1) |
| 114 | |
| 115 | def test_nonexistent_attribute(self): |
| 116 | def f( |
nothing calls this directly
no test coverage detected