def test_partition_value_error(synthetic_dataset, reader_factory):
    """Tests that the reader raises value errors when appropriate"""

    # shard_count has to be greater than 0
    with pytest.raises(ValueError):
        reader_factory(synthetic_dataset.url, shard_count=0)

    # missing cur_shard value
    with pytest.raises(ValueError):
        reader_factory(synthetic_dataset.url, shard_count=5)

    # cur_shard is a string
    with pytest.raises(ValueError):
        reader_factory(synthetic_dataset.url, cur_shard='0',
                       shard_count=5)

    # shard_count is a string
    with pytest.raises(ValueError):
        reader_factory(synthetic_dataset.url, cur_shard=0,
                       shard_count='5')
Tests that the reader raises value errors when appropriate
petastorm/tests/test_end_to_end.py