diff --git a/tests/test_fits.py b/tests/test_fits.py index e34e1d14..470c6a74 100644 --- a/tests/test_fits.py +++ b/tests/test_fits.py @@ -9,6 +9,8 @@ from scipy.odr import ODR, Model, Data, RealData import pyerrors as pe import pytest +np.random.seed(0) + def test_standard_fit(): dim = 10 + int(30 * np.random.rand()) x = np.arange(dim) diff --git a/tests/test_linalg.py b/tests/test_linalg.py index 9d7f6377..e13c80d5 100644 --- a/tests/test_linalg.py +++ b/tests/test_linalg.py @@ -11,6 +11,8 @@ from scipy.odr import ODR, Model, Data, RealData import pyerrors as pe import pytest +np.random.seed(0) + def test_matrix_functions(): dim = 3 + int(4 * np.random.rand()) print(dim) diff --git a/tests/test_pyerrors.py b/tests/test_pyerrors.py index 393cde8d..fcc00e6d 100644 --- a/tests/test_pyerrors.py +++ b/tests/test_pyerrors.py @@ -6,6 +6,8 @@ import copy import pyerrors as pe import pytest +np.random.seed(0) + def test_dump(): value = np.random.normal(5, 10) dvalue = np.abs(np.random.normal(0, 1)) diff --git a/tests/test_roots.py b/tests/test_roots.py index a6ce3d65..dce0eb45 100644 --- a/tests/test_roots.py +++ b/tests/test_roots.py @@ -2,7 +2,9 @@ import numpy as np import pyerrors as pe import pytest -def test_find_root(): +np.random.seed(0) + +def test_root_linear(): def root_function(x, d): return x - d @@ -12,3 +14,6 @@ def test_find_root(): my_root = pe.roots.find_root(my_obs, root_function) assert np.isclose(my_root.value, value) + difference = my_obs - my_root + assert all(np.isclose(0.0, difference.deltas['t'])) +