(self)
| 2020 | self.assertEqual(X1, X2) |
| 2021 | |
| 2022 | def test_special_attrs(self): |
| 2023 | # Forward refs provide a different introspection API. __name__ and |
| 2024 | # __qualname__ make little sense for forward refs as they can store |
| 2025 | # complex typing expressions. |
| 2026 | fr = ForwardRef("set[Any]") |
| 2027 | self.assertNotHasAttr(fr, "__name__") |
| 2028 | self.assertNotHasAttr(fr, "__qualname__") |
| 2029 | self.assertEqual(fr.__module__, "annotationlib") |
| 2030 | # Forward refs are currently unpicklable once they contain a code object. |
| 2031 | fr.__forward_code__ # fill the cache |
| 2032 | for proto in range(pickle.HIGHEST_PROTOCOL + 1): |
| 2033 | with self.assertRaises(TypeError): |
| 2034 | pickle.dumps(fr, proto) |
| 2035 | |
| 2036 | def test_evaluate_string_format(self): |
| 2037 | fr = ForwardRef("set[Any]") |
nothing calls this directly
no test coverage detected