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

Method test_quantize

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

Source from the content-addressed store, hash-verified

4687 self.assertTrue(c.flags[Overflow])
4688
4689 def test_quantize(self):
4690 Decimal = self.decimal.Decimal
4691 localcontext = self.decimal.localcontext
4692 InvalidOperation = self.decimal.InvalidOperation
4693
4694 with localcontext() as c:
4695 c.prec = 1
4696 c.Emax = 1
4697 c.Emin = -1
4698 c.traps[InvalidOperation] = False
4699 x = Decimal(99).quantize(Decimal("1e1"))
4700 self.assertTrue(x.is_nan())
4701
4702 def test_radix(self):
4703 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

localcontextFunction · 0.85
DecimalClass · 0.85
assertTrueMethod · 0.80
quantizeMethod · 0.45
is_nanMethod · 0.45

Tested by

no test coverage detected