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

Method check_format_1

Lib/test/test_long.py:307–314  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

305 "".join("0123456789abcdef"[i] for i in digits)
306
307 def check_format_1(self, x):
308 for base, mapper in (2, bin), (8, oct), (10, str), (10, repr), (16, hex):
309 got = mapper(x)
310 with self.subTest(x=x, mapper=mapper.__name__):
311 expected = self.slow_format(x, base)
312 self.assertEqual(got, expected)
313 with self.subTest(got=got):
314 self.assertEqual(int(got, 0), x)
315
316 def test_format(self):
317 for x in special:

Callers 1

test_formatMethod · 0.95

Calls 3

slow_formatMethod · 0.95
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected