(monkeypatch)
| 858 | |
| 859 | |
| 860 | def test_auto_blocksize_csv(monkeypatch): |
| 861 | psutil = pytest.importorskip("psutil") |
| 862 | total_memory = psutil.virtual_memory().total |
| 863 | cpu_count = psutil.cpu_count() |
| 864 | mock_read_bytes = mock.Mock(wraps=read_bytes) |
| 865 | monkeypatch.setattr(dask.dataframe.io.csv, "read_bytes", mock_read_bytes) |
| 866 | |
| 867 | expected_block_size = auto_blocksize(total_memory, cpu_count) |
| 868 | with filetexts(csv_files, mode="b"): |
| 869 | dd.read_csv("2014-01-01.csv") |
| 870 | assert mock_read_bytes.called |
| 871 | assert mock_read_bytes.call_args[1]["blocksize"] == expected_block_size |
| 872 | |
| 873 | |
| 874 | def test_head_partial_line_fix(): |
nothing calls this directly
no test coverage detected