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

Method test_precision_c_limits

Lib/test/test_format.py:640–650  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

638
639 @support.cpython_only
640 def test_precision_c_limits(self):
641 _testcapi = import_module("_testcapi")
642 INT_MAX = _testcapi.INT_MAX
643
644 f = 1.2
645 with self.assertRaises(ValueError) as cm:
646 format(f, ".%sf" % (INT_MAX + 1))
647
648 c = complex(f)
649 with self.assertRaises(ValueError) as cm:
650 format(c, ".%sf" % (INT_MAX + 1))
651
652 def test_g_format_has_no_trailing_zeros(self):
653 # regression test for bugs.python.org/issue40780

Callers

nothing calls this directly

Calls 3

import_moduleFunction · 0.90
formatFunction · 0.85
assertRaisesMethod · 0.45

Tested by

no test coverage detected