MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_float_write

Method test_float_write

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

Source from the content-addressed store, hash-verified

1102 self.assertEqual(fileobj.read(), expected)
1103
1104 def test_float_write(self):
1105 import array
1106 contents = [(20-i)*0.1 for i in range(20)]
1107 a = array.array('f', contents)
1108 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
1109 writer = csv.writer(fileobj, dialect="excel")
1110 writer.writerow(a)
1111 expected = ",".join([str(i) for i in a])+"\r\n"
1112 fileobj.seek(0)
1113 self.assertEqual(fileobj.read(), expected)
1114
1115 @unittest.expectedFailure # TODO: RUSTPYTHON
1116 def test_char_write(self):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected