test_roots added

This commit is contained in:
Fabian Joswig 2021-10-15 12:56:07 +01:00
parent 112890c9d2
commit 1b63f5dd3b

14
tests/test_roots.py Normal file
View file

@ -0,0 +1,14 @@
import numpy as np
import pyerrors as pe
import pytest
def test_find_root():
def root_function(x, d):
return x - d
value = np.random.normal(0, 100)
my_obs = pe.pseudo_Obs(value, 0.1, 't')
my_root = pe.roots.find_root(my_obs, root_function)
assert np.isclose(my_root.value, value)