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

Method test_subtract

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

Source from the content-addressed store, hash-verified

3647 self.assertRaises(TypeError, c.shift, 1, '2')
3648
3649 def test_subtract(self):
3650 Decimal = self.decimal.Decimal
3651 Context = self.decimal.Context
3652
3653 c = Context()
3654 d = c.subtract(Decimal(1), Decimal(2))
3655 self.assertEqual(c.subtract(1, 2), d)
3656 self.assertEqual(c.subtract(Decimal(1), 2), d)
3657 self.assertEqual(c.subtract(1, Decimal(2)), d)
3658 self.assertRaises(TypeError, c.subtract, '1', 2)
3659 self.assertRaises(TypeError, c.subtract, 1, '2')
3660
3661 def test_to_eng_string(self):
3662 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected