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

Method test_char_write

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

Source from the content-addressed store, hash-verified

1088 self.assertEqual(fileobj.read(), expected)
1089
1090 def test_char_write(self):
1091 import array, string
1092 a = array.array('w', string.ascii_letters)
1093
1094 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
1095 writer = csv.writer(fileobj, dialect="excel")
1096 writer.writerow(a)
1097 expected = ",".join(a)+"\r\n"
1098 fileobj.seek(0)
1099 self.assertEqual(fileobj.read(), expected)
1100
1101class TestDialectValidity(unittest.TestCase):
1102 def test_quoting(self):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected