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

Method test_format_specifiers

Lib/test/test_tstring.py:82–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80 self.assertEqual(fstring(t), "Name: Bob, Age: 30")
81
82 def test_format_specifiers(self):
83 # Test basic format specifiers
84 value = 3.14159
85 t = t"Pi: {value:.2f}"
86 self.assertTStringEqual(
87 t, ("Pi: ", ""), [(value, "value", None, ".2f")]
88 )
89 self.assertEqual(fstring(t), "Pi: 3.14")
90
91 def test_conversions(self):
92 # Test !s conversion (str)

Callers

nothing calls this directly

Calls 3

fstringFunction · 0.90
assertTStringEqualMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected