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

Method test_sizeof

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

Source from the content-addressed store, hash-verified

5694 self.assertEqual(str(Decimal(x)), '-sNaN1')
5695
5696 def test_sizeof(self):
5697 Decimal = C.Decimal
5698 HAVE_CONFIG_64 = (C.MAX_PREC > 425000000)
5699
5700 self.assertGreater(Decimal(0).__sizeof__(), 0)
5701 if HAVE_CONFIG_64:
5702 x = Decimal(10**(19*24)).__sizeof__()
5703 y = Decimal(10**(19*25)).__sizeof__()
5704 self.assertEqual(y, x+8)
5705 else:
5706 x = Decimal(10**(9*24)).__sizeof__()
5707 y = Decimal(10**(9*25)).__sizeof__()
5708 self.assertEqual(y, x+4)
5709
5710 def test_internal_use_of_overridden_methods(self):
5711 Decimal = C.Decimal

Callers

nothing calls this directly

Calls 4

DecimalClass · 0.85
assertGreaterMethod · 0.80
__sizeof__Method · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected