MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_precision_c_limits

Method test_precision_c_limits

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

Source from the content-addressed store, hash-verified

484
485 @support.cpython_only
486 def test_precision_c_limits(self):
487 _testcapi = import_module("_testcapi")
488 INT_MAX = _testcapi.INT_MAX
489
490 f = 1.2
491 with self.assertRaises(ValueError) as cm:
492 format(f, ".%sf" % (INT_MAX + 1))
493
494 c = complex(f)
495 with self.assertRaises(ValueError) as cm:
496 format(c, ".%sf" % (INT_MAX + 1))
497
498 def test_g_format_has_no_trailing_zeros(self):
499 # regression test for bugs.python.org/issue40780

Callers

nothing calls this directly

Calls 3

import_moduleFunction · 0.90
formatFunction · 0.50
assertRaisesMethod · 0.45

Tested by

no test coverage detected