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

Method test_compare

Lib/test/test_decimal.py:3105–3115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3103 self.assertRaises(TypeError, c.add, 1, '1')
3104
3105 def test_compare(self):
3106 Decimal = self.decimal.Decimal
3107 Context = self.decimal.Context
3108
3109 c = Context()
3110 d = c.compare(Decimal(1), Decimal(1))
3111 self.assertEqual(c.compare(1, 1), d)
3112 self.assertEqual(c.compare(Decimal(1), 1), d)
3113 self.assertEqual(c.compare(1, Decimal(1)), d)
3114 self.assertRaises(TypeError, c.compare, '1', 1)
3115 self.assertRaises(TypeError, c.compare, 1, '1')
3116
3117 def test_compare_signal(self):
3118 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

compareMethod · 0.95
DecimalClass · 0.85
ContextClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected