Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe56c15

Browse files
author
ArturoAmorQ
committed
Add tests for tol validation
1 parent 1475fd0 commit fe56c15

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sklearn/linear_model/tests/test_ridge.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,17 @@ def test_ridge_individual_penalties():
351351
"max_iter must be an instance of <class 'numbers.Integral'>, not <class"
352352
" 'str'>",
353353
),
354+
({"tol": -1.0}, ValueError, "tol == -1.0, must be >= 0."),
355+
(
356+
{"tol": 1},
357+
TypeError,
358+
"tol must be an instance of <class 'float'>, not <class 'int'>",
359+
),
360+
(
361+
{"tol": "1"},
362+
TypeError,
363+
"tol must be an instance of <class 'float'>, not <class 'str'>",
364+
),
354365
],
355366
)
356367
def test_Ridge_params_validation(params, err_type, err_msg):

0 commit comments

Comments
 (0)