Skip to content

Commit d583456

Browse files
authored
TST add more test for discovery module (#80)
1 parent c0e26ed commit d583456

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

skltemplate/utils/tests/test_discovery.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
# Authors: scikit-learn-contrib developers
22
# License: BSD 3 clause
33

4+
import pytest
5+
46
from skltemplate.utils.discovery import all_displays, all_estimators, all_functions
57

68

79
def test_all_estimators():
810
estimators = all_estimators()
911
assert len(estimators) == 3
1012

13+
estimators = all_estimators(type_filter="classifier")
14+
assert len(estimators) == 1
15+
16+
estimators = all_estimators(type_filter=["classifier", "transformer"])
17+
assert len(estimators) == 2
18+
19+
err_msg = "Parameter type_filter must be"
20+
with pytest.raises(ValueError, match=err_msg):
21+
all_estimators(type_filter="xxxx")
22+
1123

1224
def test_all_displays():
1325
displays = all_displays()

0 commit comments

Comments
 (0)