def test_span_maker_forward_with_empty():
    """The forward pass of the span maker may have a doc with no entities."""
    nlp = English()
    doc1 = nlp("a b c")
    ent = doc1[0:1]
    ent.label_ = "X"
    doc1.ents = [ent]
    # no entities
    doc2 = nlp("x y z")

    # just to get a model
    span_maker = build_span_maker()
    span_maker([doc1, doc2], False)
The forward pass of the span maker may have a doc with no entities.
spacy/tests/pipeline/test_entity_linker.py