(self)
| 2120 | ) |
| 2121 | |
| 2122 | def test_fwdref_with_module(self): |
| 2123 | self.assertIs(ForwardRef("Format", module="annotationlib").evaluate(), Format) |
| 2124 | self.assertIs( |
| 2125 | ForwardRef("Counter", module="collections").evaluate(), collections.Counter |
| 2126 | ) |
| 2127 | self.assertEqual( |
| 2128 | ForwardRef("Counter[int]", module="collections").evaluate(), |
| 2129 | collections.Counter[int], |
| 2130 | ) |
| 2131 | |
| 2132 | with self.assertRaises(NameError): |
| 2133 | # If globals are passed explicitly, we don't look at the module dict |
| 2134 | ForwardRef("Format", module="annotationlib").evaluate(globals={}) |
| 2135 | |
| 2136 | def test_fwdref_to_builtin(self): |
| 2137 | self.assertIs(ForwardRef("int").evaluate(), int) |
nothing calls this directly
no test coverage detected