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

Method _write_error_test

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

Source from the content-addressed store, hash-verified

183 expect + writer.dialect.lineterminator)
184
185 def _write_error_test(self, exc, fields, **kwargs):
186 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
187 writer = csv.writer(fileobj, **kwargs)
188 with self.assertRaises(exc):
189 writer.writerow(fields)
190 fileobj.seek(0)
191 self.assertEqual(fileobj.read(), '')
192
193 def test_write_arg_valid(self):
194 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
writerowMethod · 0.80
writerMethod · 0.45
assertRaisesMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected