chore: Exception in least_squares specified.

This commit is contained in:
Fabian Joswig 2023-03-08 16:45:29 +00:00
parent e6051d7ba0
commit 80f4eef912
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View file

@ -713,15 +713,15 @@ def test_combined_fit_invalid_fit_functions():
def test_combined_fit_invalid_input():
xvals =[]
yvals =[]
xvals = []
yvals = []
err = 0.1
def func_valid(a,x):
return a[0] + a[1] * x
for x in range(1, 8, 2):
xvals.append(x)
yvals.append(pe.pseudo_Obs(x + np.random.normal(0.0, err), err, 'test1') + pe.pseudo_Obs(0, err / 100, 'test2', samples=87))
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.least_squares({'a':xvals}, {'b':yvals}, {'a':func_valid})
with pytest.raises(Exception):
pe.least_squares({'a':xvals}, {'a':yvals}, {'a':func_valid})