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

Method test_next_toward

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

Source from the content-addressed store, hash-verified

3501 self.assertRaises(TypeError, c.next_plus, '10')
3502
3503 def test_next_toward(self):
3504 Decimal = self.decimal.Decimal
3505 Context = self.decimal.Context
3506
3507 c = Context()
3508 d = c.next_toward(Decimal(1), Decimal(2))
3509 self.assertEqual(c.next_toward(1, 2), d)
3510 self.assertEqual(c.next_toward(Decimal(1), 2), d)
3511 self.assertEqual(c.next_toward(1, Decimal(2)), d)
3512 self.assertRaises(TypeError, c.next_toward, '1', 2)
3513 self.assertRaises(TypeError, c.next_toward, 1, '2')
3514
3515 def test_normalize(self):
3516 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected