From 1b63f5dd3b75f4f7e327268bda8591a84237bafd Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 15 Oct 2021 12:56:07 +0100 Subject: [PATCH] test_roots added --- tests/test_roots.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/test_roots.py diff --git a/tests/test_roots.py b/tests/test_roots.py new file mode 100644 index 00000000..a6ce3d65 --- /dev/null +++ b/tests/test_roots.py @@ -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)