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

Method test_compare_fieldless

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

Source from the content-addressed store, hash-verified

748 )
749
750 def test_compare_fieldless(self):
751 self.assertTrue(ast.compare(ast.Add(), ast.Add()))
752 self.assertFalse(ast.compare(ast.Sub(), ast.Add()))
753
754 # test that missing runtime fields is handled in ast.compare()
755 a1, a2 = ast.Name('a'), ast.Name('a')
756 self.assertTrue(ast.compare(a1, a2))
757 self.assertTrue(ast.compare(a1, a2))
758 del a1.id
759 self.assertFalse(ast.compare(a1, a2))
760 del a2.id
761 self.assertTrue(ast.compare(a1, a2))
762
763 def test_compare_modes(self):
764 for mode, sources in (

Callers

nothing calls this directly

Calls 3

assertTrueMethod · 0.80
assertFalseMethod · 0.80
compareMethod · 0.45

Tested by

no test coverage detected