(self)
| 322 | |
| 323 | @pytest.mark.numpy |
| 324 | def test_stress_block_sizes(self): |
| 325 | # Test a number of small block sizes to stress block stitching |
| 326 | for extra_whitespace in (False, True): |
| 327 | data_base, max_line_len, expected = make_random_json( |
| 328 | num_cols=2, num_rows=100, |
| 329 | extra_whitespace=extra_whitespace) |
| 330 | block_sizes = [max_line_len, max_line_len + 4, max_line_len + 15] |
| 331 | |
| 332 | read_options = ReadOptions() |
| 333 | parse_options = ParseOptions() |
| 334 | |
| 335 | for data in [data_base, data_base.rstrip(b'\r\n')]: |
| 336 | for newlines_in_values in [False, True]: |
| 337 | parse_options.newlines_in_values = newlines_in_values |
| 338 | for block_size in block_sizes: |
| 339 | read_options.block_size = block_size |
| 340 | table = self.read_bytes(data, read_options=read_options, |
| 341 | parse_options=parse_options) |
| 342 | assert table.schema == expected.schema |
| 343 | if not table.equals(expected): |
| 344 | # Better error output |
| 345 | assert table.to_pydict() == expected.to_pydict() |
| 346 | |
| 347 | |
| 348 | class BaseTestJSONRead(BaseTestJSON): |
nothing calls this directly
no test coverage detected