(self)
| 1894 | assert table.to_pydict() == expected.to_pydict() |
| 1895 | |
| 1896 | def test_stress_block_sizes(self): |
| 1897 | # Test a number of small block sizes to stress block stitching |
| 1898 | csv_base, expected = make_random_csv(num_cols=2, num_rows=500) |
| 1899 | block_sizes = [19, 21, 23, 26, 37, 111] |
| 1900 | csvs = [csv_base, csv_base.rstrip(b'\r\n')] |
| 1901 | for csv in csvs: |
| 1902 | for block_size in block_sizes: |
| 1903 | # Need at least two lines for type inference |
| 1904 | assert csv[:block_size].count(b'\n') >= 2 |
| 1905 | read_options = ReadOptions(block_size=block_size) |
| 1906 | reader = self.open_bytes( |
| 1907 | csv, read_options=read_options) |
| 1908 | table = reader.read_all() |
| 1909 | assert table.schema == expected.schema |
| 1910 | if not table.equals(expected): |
| 1911 | # Better error output |
| 1912 | assert table.to_pydict() == expected.to_pydict() |
| 1913 | |
| 1914 | def test_batch_lifetime(self): |
| 1915 | gc.collect() |
nothing calls this directly
no test coverage detected