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

Method test_divide

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

Source from the content-addressed store, hash-verified

3190 self.assertRaises(TypeError, c.copy_sign, 1, '-2')
3191
3192 def test_divide(self):
3193 Decimal = self.decimal.Decimal
3194 Context = self.decimal.Context
3195
3196 c = Context()
3197 d = c.divide(Decimal(1), Decimal(2))
3198 self.assertEqual(c.divide(1, 2), d)
3199 self.assertEqual(c.divide(Decimal(1), 2), d)
3200 self.assertEqual(c.divide(1, Decimal(2)), d)
3201 self.assertRaises(TypeError, c.divide, '1', 2)
3202 self.assertRaises(TypeError, c.divide, 1, '2')
3203
3204 def test_divide_int(self):
3205 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected