Skip to content

Commit

Permalink
Call _validate_steps in pipeline tests
Browse files Browse the repository at this point in the history
This is a required step as that method is not called by scikit-learn
during pipeline construction
  • Loading branch information
danilobellini committed Jul 15, 2023
1 parent f7a8e95 commit 6fc2c3d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_validate_steps(self):
("bad", Thing()),
("model", MockEstimator()),
]
)
)._validate_steps()

# validate a bad intermediate transformer on the VisualPipeline
with pytest.raises(TypeError):
Expand All @@ -102,15 +102,17 @@ def test_validate_steps(self):
("bad", Thing()),
("model", MockEstimator()),
]
)
)._validate_steps()

# validate a bad final estimator on the Pipeline
with pytest.raises(TypeError):
Pipeline([("real", MockTransformer()), ("bad", Thing())])
Pipeline([("real", MockTransformer()), ("bad", Thing())])._validate_steps()

# validate a bad final estimator on the VisualPipeline
with pytest.raises(TypeError):
VisualPipeline([("real", MockTransformer()), ("bad", Thing())])
VisualPipeline(
[("real", MockTransformer()), ("bad", Thing())]
)._validate_steps()

# validate visual transformers on a Pipeline
try:
Expand Down

0 comments on commit 6fc2c3d

Please sign in to comment.