(self)
| 10029 | self.assertIs(type(field_c3.__metadata__[0]), bool) |
| 10030 | |
| 10031 | def test_forwardref_partial_evaluation(self): |
| 10032 | # Test that Annotated partially evaluates if it contains a ForwardRef |
| 10033 | # See: https://github.com/python/cpython/issues/137706 |
| 10034 | def f(x: Annotated[undefined, '']): pass |
| 10035 | |
| 10036 | ann = annotationlib.get_annotations(f, format=annotationlib.Format.FORWARDREF) |
| 10037 | |
| 10038 | # Test that the attributes are retrievable from the partially evaluated annotation |
| 10039 | x_ann = ann['x'] |
| 10040 | self.assertIs(get_origin(x_ann), Annotated) |
| 10041 | self.assertEqual(x_ann.__origin__, EqualToForwardRef('undefined', owner=f)) |
| 10042 | self.assertEqual(x_ann.__metadata__, ('',)) |
| 10043 | |
| 10044 | |
| 10045 | class TypeAliasTests(BaseTestCase): |
nothing calls this directly
no test coverage detected