def test_ngram_delta_small_threshold(reader_factory, dataset_range_0_99_5):
    """Test to verify that a small threshold work in ngrams."""

    fields = {
        0: [TestSchema.id, TestSchema.id2, TestSchema.image_png, TestSchema.matrix],
        1: [TestSchema.id, TestSchema.id2, TestSchema.sensor_name],
    }
    ngram = NGram(fields=fields, delta_threshold=1, timestamp_field=TestSchema.id)
    with reader_factory(dataset_range_0_99_5.url, schema_fields=ngram) as reader:
        with pytest.raises(StopIteration):
            next(reader)
Test to verify that a small threshold work in ngrams.
petastorm/tests/test_ngram_end_to_end.py