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

Method test_to_integral_value

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

Source from the content-addressed store, hash-verified

3686 self.assertRaises(TypeError, c.to_integral_exact, '10')
3687
3688 def test_to_integral_value(self):
3689 Decimal = self.decimal.Decimal
3690 Context = self.decimal.Context
3691
3692 c = Context()
3693 d = c.to_integral_value(Decimal(10))
3694 self.assertEqual(c.to_integral_value(10), d)
3695 self.assertRaises(TypeError, c.to_integral_value, '10')
3696 self.assertRaises(TypeError, c.to_integral_value, 10, 'x')
3697
3698@requires_cdecimal
3699class CContextAPItests(ContextAPItests, unittest.TestCase):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected