(self)
| 1824 | assert table.to_pydict() == expected.to_pydict() |
| 1825 | |
| 1826 | def test_stress_block_sizes(self): |
| 1827 | # Test a number of small block sizes to stress block stitching |
| 1828 | csv_base, expected = make_random_csv(num_cols=2, num_rows=500) |
| 1829 | block_sizes = [19, 21, 23, 26, 37, 111] |
| 1830 | csvs = [csv_base, csv_base.rstrip(b'\r\n')] |
| 1831 | for csv in csvs: |
| 1832 | for block_size in block_sizes: |
| 1833 | # Need at least two lines for type inference |
| 1834 | assert csv[:block_size].count(b'\n') >= 2 |
| 1835 | read_options = ReadOptions(block_size=block_size) |
| 1836 | reader = self.open_bytes( |
| 1837 | csv, read_options=read_options) |
| 1838 | table = reader.read_all() |
| 1839 | assert table.schema == expected.schema |
| 1840 | if not table.equals(expected): |
| 1841 | # Better error output |
| 1842 | assert table.to_pydict() == expected.to_pydict() |
| 1843 | |
| 1844 | def test_batch_lifetime(self): |
| 1845 | gc.collect() |
nothing calls this directly
no test coverage detected