MCPcopy Create free account
hub / github.com/dask/dask / test_auto_blocksize_csv

Function test_auto_blocksize_csv

dask/dataframe/io/tests/test_csv.py:860–871  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

858
859
860def 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
874def test_head_partial_line_fix():

Callers

nothing calls this directly

Calls 3

auto_blocksizeFunction · 0.90
filetextsFunction · 0.90
read_csvMethod · 0.80

Tested by

no test coverage detected