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

Method _write_error_test

Lib/test/test_csv.py:187–193  ·  view source on GitHub ↗
(self, exc, fields, **kwargs)

Source from the content-addressed store, hash-verified

185 expect + writer.dialect.lineterminator)
186
187 def _write_error_test(self, exc, fields, **kwargs):
188 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
189 writer = csv.writer(fileobj, **kwargs)
190 with self.assertRaises(exc):
191 writer.writerow(fields)
192 fileobj.seek(0)
193 self.assertEqual(fileobj.read(), '')
194
195 def test_write_arg_valid(self):
196 self._write_error_test(csv.Error, None)

Callers 6

test_write_arg_validMethod · 0.95
test_write_quotingMethod · 0.95
test_write_escapeMethod · 0.95
test_write_iterableMethod · 0.95

Calls 7

TemporaryFileFunction · 0.90
writerMethod · 0.45
assertRaisesMethod · 0.45
writerowMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected