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

Method test_add

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

Source from the content-addressed store, hash-verified

3091 self.assertRaises(TypeError, c.abs, '-1')
3092
3093 def test_add(self):
3094 Decimal = self.decimal.Decimal
3095 Context = self.decimal.Context
3096
3097 c = Context()
3098 d = c.add(Decimal(1), Decimal(1))
3099 self.assertEqual(c.add(1, 1), d)
3100 self.assertEqual(c.add(Decimal(1), 1), d)
3101 self.assertEqual(c.add(1, Decimal(1)), d)
3102 self.assertRaises(TypeError, c.add, '1', 1)
3103 self.assertRaises(TypeError, c.add, 1, '1')
3104
3105 def test_compare(self):
3106 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected