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

Method test_min_mag

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

Source from the content-addressed store, hash-verified

3450 self.assertRaises(TypeError, c.min, 1, '2')
3451
3452 def test_min_mag(self):
3453 Decimal = self.decimal.Decimal
3454 Context = self.decimal.Context
3455
3456 c = Context()
3457 d = c.min_mag(Decimal(1), Decimal(2))
3458 self.assertEqual(c.min_mag(1, 2), d)
3459 self.assertEqual(c.min_mag(Decimal(1), 2), d)
3460 self.assertEqual(c.min_mag(1, Decimal(2)), d)
3461 self.assertRaises(TypeError, c.min_mag, '1', 2)
3462 self.assertRaises(TypeError, c.min_mag, 1, '2')
3463
3464 def test_minus(self):
3465 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected