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

Method test_compare_basics

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

Source from the content-addressed store, hash-verified

666 self.assertCountEqual(ast.expr.__doc__.split("\n"), expressions)
667
668 def test_compare_basics(self):
669 self.assertTrue(ast.compare(ast.parse("x = 10"), ast.parse("x = 10")))
670 self.assertFalse(ast.compare(ast.parse("x = 10"), ast.parse("")))
671 self.assertFalse(ast.compare(ast.parse("x = 10"), ast.parse("x")))
672 self.assertFalse(
673 ast.compare(ast.parse("x = 10;y = 20"), ast.parse("class C:pass"))
674 )
675
676 def test_compare_modified_ast(self):
677 # The ast API is a bit underspecified. The objects are mutable,

Callers

nothing calls this directly

Calls 4

assertTrueMethod · 0.80
assertFalseMethod · 0.80
compareMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected