From 7ee102795f643f047826cc0a7dbe012fd9aca87f Mon Sep 17 00:00:00 2001 From: Mikolaj-A-Kowalski <32641577+Mikolaj-A-Kowalski@users.noreply.github.com> Date: Tue, 17 Mar 2020 19:15:09 +0000 Subject: [PATCH] Remove non-default tolerance from test_cell.py --- tests/unit_tests/test_cell.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/unit_tests/test_cell.py b/tests/unit_tests/test_cell.py index 30eb82ca1..1a01a0f6c 100644 --- a/tests/unit_tests/test_cell.py +++ b/tests/unit_tests/test_cell.py @@ -9,9 +9,6 @@ import pytest from tests.unit_tests import assert_unbounded from openmc.data import atomic_mass, AVOGADRO -# Relative tolerance for float comparison -TOL = 1e-9 - def test_contains(): # Cell with specified region @@ -172,7 +169,7 @@ def test_atoms_material_cell(uo2, water): tuples = list(c.atoms.items()) for nuc, atom_num, t in zip(expected_nucs, expected_atoms, tuples): assert nuc == t[0] - assert atom_num == pytest.approx(t[1], rel=TOL) + assert atom_num == pytest.approx(t[1]) # Change material and check if OK c.fill = water @@ -185,7 +182,7 @@ def test_atoms_material_cell(uo2, water): tuples = list(c.atoms.items()) for nuc, atom_num, t in zip(expected_nucs, expected_atoms, tuples): assert nuc == t[0] - assert atom_num == pytest.approx(t[1], rel=TOL) + assert atom_num == pytest.approx(t[1]) def test_atoms_distribmat_cell(uo2, water): @@ -208,7 +205,7 @@ def test_atoms_distribmat_cell(uo2, water): tuples = list(c.atoms.items()) for nuc, atom_num, t in zip(expected_nucs, expected_atoms, tuples): assert nuc == t[0] - assert atom_num == pytest.approx(t[1], rel=TOL) + assert atom_num == pytest.approx(t[1]) def test_atoms_errors(cell_with_lattice): @@ -237,7 +234,7 @@ def test_nuclide_densities(uo2): tuples = list(c.get_nuclide_densities().values()) for nuc, density, t in zip(expected_nucs, expected_density, tuples): assert nuc == t[0] - assert density == pytest.approx(t[1], rel=TOL) + assert density == pytest.approx(t[1]) # Empty cell c = openmc.Cell()