diff --git a/poetry.lock b/poetry.lock index 20a8674..75b1844 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1113,7 +1113,6 @@ pyside2 = [ {file = "PySide2-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win32.whl", hash = "sha256:7c91a5074f3c60bac7e9336943a1dc9d5c8be8ab88a232dc55018e555dae81b2"}, {file = "PySide2-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win_amd64.whl", hash = "sha256:2d72150f63025b9b55097c1a64d09da37ff9191f73f69237500dec7a4a130541"}, {file = "PySide2-5.15.0-5.15.0_1-cp35.cp36.cp37.cp38-none-win_amd64.whl", hash = "sha256:7ac86f31bc0a4fbf3f0bf00890e849441776be304c7b8bf259d777a7fe5fe913"}, - {file = "PySide2-5.15.0-5.15.0_2-cp35.cp36.cp37.cp38-none-win_amd64.whl", hash = "sha256:fad5ce781d0774bfad39f54b6c3376909b8d27f2075cbde6f4499df7dbd855f9"}, ] pytest = [ {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, @@ -1187,7 +1186,6 @@ shiboken2 = [ {file = "shiboken2-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win32.whl", hash = "sha256:4b0904e0967356a36e80cde05981faa14c120141856d973ee983eac0b83633c0"}, {file = "shiboken2-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win_amd64.whl", hash = "sha256:19d5f715e5ae8a815a7f148a8614a3225dceee6fd9d5decaa7749657f0f7ccbe"}, {file = "shiboken2-5.15.0-5.15.0_1-cp35.cp36.cp37.cp38-none-win_amd64.whl", hash = "sha256:94991848e9ff4d03c2d7feab484113b5b5ad7f9fdfa0b0ff46ce18da47b36b58"}, - {file = "shiboken2-5.15.0-5.15.0_2-cp35.cp36.cp37.cp38-none-win_amd64.whl", hash = "sha256:e753324a78cbdab1c5917b5600c708a8db7e1336579e7afa20ed90edda15eefa"}, ] six = [ {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, diff --git a/tests/test_example/test_hello.py b/tests/test_example/test_hello.py index 5e5098e..f6084af 100644 --- a/tests/test_example/test_hello.py +++ b/tests/test_example/test_hello.py @@ -11,8 +11,14 @@ @pytest.mark.parametrize( ("trajectory", "lindemannindex"), [ - ("tests/test_example/459_01.lammpstrj", np.float(0.025923892565654555)), - ("tests/test_example/459_02.lammpstrj", np.float(0.026426709832984754)), + ( + "tests/test_example/459_01.lammpstrj", + np.round(np.float(0.025923892565654555), 12), + ), + ( + "tests/test_example/459_02.lammpstrj", + np.round(np.float(0.026426709832984754), 12), + ), ], ) # def test_setup(trajectory: str, lindemannindex: np.float) -> bool: @@ -21,31 +27,45 @@ def test_tra(trajectory, lindemannindex): """Example test with parametrization.""" frame = read.frames(trajectory) - assert per_trj.calculate(frame) == lindemannindex + assert np.round(per_trj.calculate(frame), 12) == lindemannindex @pytest.mark.parametrize( ("trajectory", "lindemannindex"), [ - ("tests/test_example/459_01.lammpstrj", np.float(0.025923892565654555)), - ("tests/test_example/459_02.lammpstrj", np.float(0.026426709832984754)), + ( + "tests/test_example/459_01.lammpstrj", + np.round(np.float(0.025923892565654555), 12), + ), + ( + "tests/test_example/459_02.lammpstrj", + np.round(np.float(0.026426709832984754), 12), + ), ], ) def test_frames(trajectory, lindemannindex): """Example test with parametrization.""" frame = read.frames(trajectory) test_array = per_frames.calculate(frame) - assert test_array[-1] == lindemannindex + assert np.round(test_array[-1], 12) == lindemannindex @pytest.mark.parametrize( ("trajectory", "lindemannindex"), [ - ("tests/test_example/459_01.lammpstrj", np.float(0.025923892565654555)), - ("tests/test_example/459_02.lammpstrj", np.float(0.026426709832984754)), + ( + "tests/test_example/459_01.lammpstrj", + np.round(np.float(0.025923892565654555), 12), + ), + ( + "tests/test_example/459_02.lammpstrj", + np.round(np.float(0.026426709832984754), 12), + ), ], ) def test_atoms(trajectory, lindemannindex): """Example test with parametrization.""" frame = read.frames(trajectory) - assert np.mean(per_atoms.calculate(frame)[-1]) == lindemannindex + assert ( + np.round(np.mean(per_atoms.calculate(frame)[-1]), 12) == lindemannindex + )