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

Method test_write_arg_valid

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

Source from the content-addressed store, hash-verified

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