MCPcopy Create free account
hub / github.com/python/cpython / test_to_integral_exact

Method test_to_integral_exact

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

Source from the content-addressed store, hash-verified

3677 self.assertRaises(TypeError, c.to_sci_string, '10')
3678
3679 def test_to_integral_exact(self):
3680 Decimal = self.decimal.Decimal
3681 Context = self.decimal.Context
3682
3683 c = Context()
3684 d = c.to_integral_exact(Decimal(10))
3685 self.assertEqual(c.to_integral_exact(10), d)
3686 self.assertRaises(TypeError, c.to_integral_exact, '10')
3687
3688 def test_to_integral_value(self):
3689 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected