(self)
| 2185 | ) |
| 2186 | |
| 2187 | def test_get_annotations_with_forwardref(self): |
| 2188 | def orig(a: int) -> nonexistent: ... |
| 2189 | lru = self.module.lru_cache(1)(orig) |
| 2190 | |
| 2191 | self.assertEqual( |
| 2192 | get_annotations(orig, format=Format.FORWARDREF), |
| 2193 | {"a": int, "return": EqualToForwardRef('nonexistent', owner=orig)}, |
| 2194 | ) |
| 2195 | self.assertEqual( |
| 2196 | get_annotations(lru, format=Format.FORWARDREF), |
| 2197 | {"a": int, "return": EqualToForwardRef('nonexistent', owner=lru)}, |
| 2198 | ) |
| 2199 | with self.assertRaises(NameError): |
| 2200 | get_annotations(orig, format=Format.VALUE) |
| 2201 | with self.assertRaises(NameError): |
| 2202 | get_annotations(lru, format=Format.VALUE) |
| 2203 | |
| 2204 | @support.skip_on_s390x |
| 2205 | @unittest.skipIf(support.is_wasi, "WASI has limited C stack") |
nothing calls this directly
no test coverage detected