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

Method test_forward_repr

Lib/test/test_annotationlib.py:1949–1962  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1947 self.assertEqual(namespace1(), namespace2())
1948
1949 def test_forward_repr(self):
1950 self.assertEqual(repr(List["int"]), "typing.List[ForwardRef('int')]")
1951 self.assertEqual(
1952 repr(List[ForwardRef("int", module="mod")]),
1953 "typing.List[ForwardRef('int', module='mod')]",
1954 )
1955 self.assertEqual(
1956 repr(List[ForwardRef("int", module="mod", is_class=True)]),
1957 "typing.List[ForwardRef('int', module='mod', is_class=True)]",
1958 )
1959 self.assertEqual(
1960 repr(List[ForwardRef("int", owner="class")]),
1961 "typing.List[ForwardRef('int', owner='class')]",
1962 )
1963
1964 def test_forward_recursion_actually(self):
1965 def namespace1():

Callers

nothing calls this directly

Calls 2

ForwardRefClass · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected