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

Method test_write_arg_valid

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

Source from the content-addressed store, hash-verified

191 self.assertEqual(fileobj.read(), '')
192
193 def test_write_arg_valid(self):
194 self._write_error_test(csv.Error, None)
195 # Check that exceptions are passed up the chain
196 self._write_error_test(OSError, BadIterable())
197 class BadList:
198 def __len__(self):
199 return 10
200 def __getitem__(self, i):
201 if i > 2:
202 raise OSError
203 self._write_error_test(OSError, BadList())
204 class BadItem:
205 def __str__(self):
206 raise OSError
207 self._write_error_test(OSError, [BadItem()])
208 def test_write_bigfield(self):
209 # This exercises the buffer realloc functionality
210 bigstring = 'X' * 50000

Callers

nothing calls this directly

Calls 4

_write_error_testMethod · 0.95
BadItemClass · 0.85
BadIterableClass · 0.70
BadListClass · 0.70

Tested by

no test coverage detected