Skip to content

Commit

Permalink
Wrapped test in flow
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsMoll committed May 20, 2024
1 parent 0d7d033 commit 7a536e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_train_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from aligned.data_source.batch_data_source import DummyDataSource
from sklearn.ensemble import RandomForestClassifier

from prefect import flow
from prefect.testing.utilities import prefect_test_harness

from src.model_registry import InMemoryModelRegristry
Expand Down Expand Up @@ -36,7 +37,8 @@ async def test_generic_classifier_train_pipeline_using_prefect():
tracker = StdoutExperimentTracker()
model = RandomForestClassifier()

with prefect_test_harness():
@flow(name="test")
def test_flow():
await classifier_from_train_test_validation_set(
store=store,
model_contract=MovieReviewIsNegative.metadata.name,
Expand All @@ -52,5 +54,8 @@ async def test_generic_classifier_train_pipeline_using_prefect():
tracker=tracker,
)

with prefect_test_harness():
test_flow()

assert len(registry.models) == 1

0 comments on commit 7a536e5

Please sign in to comment.