MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_subtract

Method test_subtract

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

Source from the content-addressed store, hash-verified

3652 self.assertRaises(TypeError, c.shift, 1, '2')
3653
3654 def test_subtract(self):
3655 Decimal = self.decimal.Decimal
3656 Context = self.decimal.Context
3657
3658 c = Context()
3659 d = c.subtract(Decimal(1), Decimal(2))
3660 self.assertEqual(c.subtract(1, 2), d)
3661 self.assertEqual(c.subtract(Decimal(1), 2), d)
3662 self.assertEqual(c.subtract(1, Decimal(2)), d)
3663 self.assertRaises(TypeError, c.subtract, '1', 2)
3664 self.assertRaises(TypeError, c.subtract, 1, '2')
3665
3666 def test_to_eng_string(self):
3667 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