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

Method test_repr

Lib/test/test_ast/test_ast.py:1050–1054  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1048 self.assert_none_check(node, attr, source)
1049
1050 def test_repr(self) -> None:
1051 snapshots = AST_REPR_DATA_FILE.read_text().split("\n")
1052 for test, snapshot in zip(ast_repr_get_test_cases(), snapshots, strict=True):
1053 with self.subTest(test_input=test):
1054 self.assertEqual(repr(ast.parse(test, optimize=False)), snapshot)
1055
1056 def test_repr_large_input_crash(self):
1057 # gh-125010: Fix use-after-free in ast repr()

Callers

nothing calls this directly

Calls 6

ast_repr_get_test_casesFunction · 0.85
splitMethod · 0.45
read_textMethod · 0.45
subTestMethod · 0.45
assertEqualMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected