def test_simple_read_with_disk_cache(synthetic_dataset, reader_factory, tmpdir):
    """Try using the Reader with LocalDiskCache using different flavors of pools"""
    CACHE_SIZE = 10 * 2 ** 30  # 20GB
    ROW_SIZE_BYTES = 100  # not really important for this test
    with reader_factory(synthetic_dataset.url, num_epochs=2,
                        cache_type='local-disk', cache_location=tmpdir.strpath,
                        cache_size_limit=CACHE_SIZE, cache_row_size_estimate=ROW_SIZE_BYTES) as reader:
        ids = _readout_all_ids(reader)
        assert 200 == len(ids)  # We read 2 epochs
        assert set(ids) == set(range(100))
Try using the Reader with LocalDiskCache using different flavors of pools
petastorm/tests/test_end_to_end.py