Skip to content

Commit 85a4a38

Browse files
authored
add tests for invalid task and diff_scheme
1 parent c323442 commit 85a4a38

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/test_odr_fit.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ def test_beta0_related(case1):
164164
with pytest.raises(ValueError):
165165
# sclb has invalid shape
166166
_ = odr_fit(**case1, scale_beta=np.array([1., 1., 1., 1., 1.]))
167+
with pytest.raises(ValueError):
168+
# invalid task
169+
_ = odr_fit(**case1, task='invalid')
167170

168171

169172
def test_delta0_related(case1, case3):
@@ -516,6 +519,9 @@ def jac_x(x: np.ndarray, beta: np.ndarray) -> np.ndarray:
516519
with pytest.raises(ValueError):
517520
_ = odr_fit(f, xdata, ydata, beta0,
518521
jac_beta=jac_beta)
522+
# invalid diff_scheme
523+
with pytest.raises(ValueError):
524+
_ = odr_fit(f, xdata, ydata, beta0, diff_scheme='invalid')
519525

520526

521527
def test_implicit_model():

0 commit comments

Comments
 (0)