def test_fail_if_resetting_in_the_middle_of_epoch(synthetic_dataset, reader_factory):
    """Tests that multiple epochs works as expected"""
    num_epochs = 5
    with reader_factory(synthetic_dataset.url, num_epochs=num_epochs) as reader:
        # Read all expected entries from the dataset and compare the data to reference
        actual_ids = _readout_all_ids(reader, limit=20)
        assert len(actual_ids) == 20

        with pytest.raises(NotImplementedError):
            reader.reset()
Tests that multiple epochs works as expected
petastorm/tests/test_end_to_end.py