MCPcopy Index your code
hub / github.com/python/cpython / test_annotations

Method test_annotations

Lib/test/test_reprlib.py:860–872  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

858 self.assertEqual(type_params[0].__bound__, str)
859
860 def test_annotations(self):
861 class My:
862 @recursive_repr()
863 def __repr__(self, default: undefined = ...):
864 return default
865
866 annotations = annotationlib.get_annotations(
867 My.__repr__, format=annotationlib.Format.FORWARDREF
868 )
869 self.assertEqual(
870 annotations,
871 {'default': EqualToForwardRef("undefined", owner=My.__repr__)}
872 )
873
874if __name__ == "__main__":
875 unittest.main()

Callers

nothing calls this directly

Calls 2

EqualToForwardRefClass · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected