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

Method test_power

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

Source from the content-addressed store, hash-verified

3540 self.assertRaises(TypeError, c.plus, '10')
3541
3542 def test_power(self):
3543 Decimal = self.decimal.Decimal
3544 Context = self.decimal.Context
3545
3546 c = Context()
3547 d = c.power(Decimal(1), Decimal(4))
3548 self.assertEqual(c.power(1, 4), d)
3549 self.assertEqual(c.power(Decimal(1), 4), d)
3550 self.assertEqual(c.power(1, Decimal(4)), d)
3551 self.assertEqual(c.power(Decimal(1), Decimal(4)), d)
3552 self.assertRaises(TypeError, c.power, '1', 4)
3553 self.assertRaises(TypeError, c.power, 1, '4')
3554 self.assertEqual(c.power(modulo=5, b=8, a=2), 1)
3555
3556 def test_quantize(self):
3557 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected