Skip to content

Commit

Permalink
add test_pipeline_with_dataset_never_cached
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed May 9, 2022
1 parent dbcd93f commit d3340ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,16 @@ def test_pipeline_with_dataset(dataset, prepared_taskmodule, mock_model, inplace
assert not (id(returned_document) == id(document))
assert not document.entities.predictions
assert returned_document.entities.predictions


@pytest.mark.slow
def test_pipeline_with_dataset_never_cached(dataset, prepared_taskmodule, mock_model):

train_dataset = dataset["train"]

pipeline = Pipeline(model=mock_model, taskmodule=prepared_taskmodule, device=-1, inplace=False)

returned_documents1 = pipeline(train_dataset, predict_field="entities")
returned_documents2 = pipeline(train_dataset, predict_field="entities")

assert returned_documents1._fingerprint != returned_documents2._fingerprint

0 comments on commit d3340ea

Please sign in to comment.