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

Method test_compare_modes

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

Source from the content-addressed store, hash-verified

761 self.assertTrue(ast.compare(a1, a2))
762
763 def test_compare_modes(self):
764 for mode, sources in (
765 ("exec", exec_tests),
766 ("eval", eval_tests),
767 ("single", single_tests),
768 ):
769 for source in sources:
770 a = ast.parse(source, mode=mode)
771 b = ast.parse(source, mode=mode)
772 self.assertTrue(
773 ast.compare(a, b), f"{ast.dump(a)} != {ast.dump(b)}"
774 )
775
776 def test_compare_attributes_option(self):
777 def parse(a, b):

Callers

nothing calls this directly

Calls 4

assertTrueMethod · 0.80
parseMethod · 0.45
compareMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected