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

Method check_ast_roundtrip

Lib/test/test_unparse.py:134–139  ·  view source on GitHub ↗
(self, code1, **kwargs)

Source from the content-addressed store, hash-verified

132
133class ASTTestCase(ASTTestMixin, unittest.TestCase):
134 def check_ast_roundtrip(self, code1, **kwargs):
135 with self.subTest(code1=code1, ast_parse_kwargs=kwargs):
136 ast1 = ast.parse(code1, **kwargs)
137 code2 = ast.unparse(ast1)
138 ast2 = ast.parse(code2, **kwargs)
139 self.assertASTEqual(ast1, ast2)
140
141 def check_invalid(self, node, raises=ValueError):
142 with self.subTest(node=node):

Callers 15

test_fstringsMethod · 0.80
test_fstrings_pep701Method · 0.80
test_tstringsMethod · 0.80
test_stringsMethod · 0.80
test_del_statementMethod · 0.80
test_shiftsMethod · 0.80
test_for_elseMethod · 0.80
test_while_elseMethod · 0.80
test_unary_parensMethod · 0.80
test_integer_parensMethod · 0.80

Calls 3

assertASTEqualMethod · 0.80
subTestMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected