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

Method test_int_write

Lib/test/test_csv.py:1056–1066  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1054
1055class TestArrayWrites(unittest.TestCase):
1056 def test_int_write(self):
1057 import array
1058 contents = [(20-i) for i in range(20)]
1059 a = array.array('i', contents)
1060
1061 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
1062 writer = csv.writer(fileobj, dialect="excel")
1063 writer.writerow(a)
1064 expected = ",".join([str(i) for i in a])+"\r\n"
1065 fileobj.seek(0)
1066 self.assertEqual(fileobj.read(), expected)
1067
1068 def test_double_write(self):
1069 import array

Callers

nothing calls this directly

Calls 8

TemporaryFileFunction · 0.90
strFunction · 0.85
writerowMethod · 0.80
writerMethod · 0.45
joinMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected