@@ -1054,19 +1054,16 @@ def test__validate_vector():
1054
1054
validate_vector (x )
1055
1055
1056
1056
1057
- def _check_sdp_from_eigen_positive_err_messages ():
1057
+ def test_check_sdp_from_eigen_positive_err_messages ():
1058
1058
"""Tests that if _check_sdp_from_eigen is given a negative tol it returns
1059
- an error, and if positive it does not"""
1060
- w = np .random .RandomState (42 ).randn (10 )
1059
+ an error, and if positive (or None) it does not"""
1060
+ w = np .abs ( np . random .RandomState (42 ).randn (10 )) + 1
1061
1061
with pytest .raises (ValueError ) as raised_error :
1062
1062
_check_sdp_from_eigen (w , - 5. )
1063
1063
assert str (raised_error .value ) == "tol should be positive."
1064
1064
with pytest .raises (ValueError ) as raised_error :
1065
1065
_check_sdp_from_eigen (w , - 1e-10 )
1066
1066
assert str (raised_error .value ) == "tol should be positive."
1067
- with pytest .raises (ValueError ) as raised_error :
1068
- _check_sdp_from_eigen (w , 1. )
1069
- assert len (raised_error .value ) == 0
1070
- with pytest .raises (ValueError ) as raised_error :
1071
- _check_sdp_from_eigen (w , 0. )
1072
- assert str (raised_error .value ) == 0
1067
+ _check_sdp_from_eigen (w , 1. )
1068
+ _check_sdp_from_eigen (w , 0. )
1069
+ _check_sdp_from_eigen (w , None )
0 commit comments