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

Method test_eq

Lib/test/test_operator.py:85–97  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

83 self.assertTrue(operator.le(1, 2.0))
84
85 def test_eq(self):
86 operator = self.module
87 class C(object):
88 def __eq__(self, other):
89 raise SyntaxError
90 self.assertRaises(TypeError, operator.eq)
91 self.assertRaises(SyntaxError, operator.eq, C(), C())
92 self.assertFalse(operator.eq(1, 0))
93 self.assertFalse(operator.eq(1, 0.0))
94 self.assertTrue(operator.eq(1, 1))
95 self.assertTrue(operator.eq(1, 1.0))
96 self.assertFalse(operator.eq(1, 2))
97 self.assertFalse(operator.eq(1, 2.0))
98
99 def test_ne(self):
100 operator = self.module

Callers

nothing calls this directly

Calls 5

assertFalseMethod · 0.80
assertTrueMethod · 0.80
CClass · 0.70
assertRaisesMethod · 0.45
eqMethod · 0.45

Tested by

no test coverage detected