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

Method test_abs

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

Source from the content-addressed store, hash-verified

3082 self.assertRaises(AttributeError, getattr, c, '_clamp')
3083
3084 def test_abs(self):
3085 Decimal = self.decimal.Decimal
3086 Context = self.decimal.Context
3087
3088 c = Context()
3089 d = c.abs(Decimal(-1))
3090 self.assertEqual(c.abs(-1), d)
3091 self.assertRaises(TypeError, c.abs, '-1')
3092
3093 def test_add(self):
3094 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected