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

Method test_format

Lib/test/test_capi/test_unicode.py:1997–2002  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1995 raise ValueError("PyUnicodeWriter_Format failed")
1996
1997 def test_format(self):
1998 from ctypes import c_int
1999 writer = self.create_writer(0)
2000 self.writer_format(writer, b'%s %i', b'abc', c_int(123))
2001 writer.write_char(ord('.'))
2002 self.assertEqual(writer.finish(), 'abc 123.')
2003
2004 def test_recover_error(self):
2005 # test recovering from PyUnicodeWriter_Format() error

Callers

nothing calls this directly

Calls 6

create_writerMethod · 0.95
writer_formatMethod · 0.95
c_intClass · 0.90
write_charMethod · 0.80
assertEqualMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected