Skip to content

Commit

Permalink
[MNT] move Pipeline exception from test_all_estimators to test `_…
Browse files Browse the repository at this point in the history
…config` (#5251)

This moves the `Pipeline` exception from `test_all_estimators` to test
`_config`.

Aware that some lines are being tested until the exception, although to
me that rather indicates that we may perhaps like to rewrite the test
instead of excepting in the middle of it.
  • Loading branch information
fkiraly committed Sep 16, 2023
1 parent 27be4b3 commit 7bf406a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions sktime/tests/_config.py
Expand Up @@ -177,6 +177,7 @@
"VECM": [
"test_hierarchical_with_exogeneous", # refer to #4743
],
"Pipeline": ["test_inheritance"], # does not inherit from intermediate base classes
}

# We use estimator tags in addition to class hierarchies to further distinguish
Expand Down
3 changes: 0 additions & 3 deletions sktime/tests/test_all_estimators.py
Expand Up @@ -26,7 +26,6 @@
)
from sktime.exceptions import NotFittedError
from sktime.forecasting.base import BaseForecaster
from sktime.pipeline.pipeline import Pipeline
from sktime.registry import all_estimators
from sktime.regression.deep_learning.base import BaseDeepRegressor
from sktime.tests._config import (
Expand Down Expand Up @@ -895,8 +894,6 @@ def test_inheritance(self, estimator_class):
f"estimator: {estimator_class} has fit method, but"
f"is not a sub-class of BaseEstimator."
)
if isinstance(Pipeline(), estimator_class):
return

# Usually estimators inherit only from one BaseEstimator type, but in some cases
# they may be predictor and transformer at the same time (e.g. pipelines)
Expand Down

0 comments on commit 7bf406a

Please sign in to comment.