mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Add pytest.approx in a few unit tests for robustness
This commit is contained in:
parent
1e1bfb40f1
commit
8547e7082a
2 changed files with 3 additions and 3 deletions
|
|
@ -159,7 +159,7 @@ def test_atoms_material_cell(uo2, water):
|
|||
tuples = c.atoms.items()
|
||||
for nuc, atom_num, t in zip(expected_nucs, expected_atoms, tuples):
|
||||
assert nuc == t[0]
|
||||
assert atom_num == t[1]
|
||||
assert atom_num == pytest.approx(t[1])
|
||||
|
||||
# Change volume and check if OK
|
||||
c.volume = 3.0
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ def test_cell(lib_init):
|
|||
def test_cell_temperature(lib_init):
|
||||
cell = openmc.lib.cells[1]
|
||||
cell.set_temperature(100.0, 0)
|
||||
assert cell.get_temperature(0) == 100.0
|
||||
assert cell.get_temperature(0) == pytest.approx(100.0)
|
||||
cell.set_temperature(200)
|
||||
assert cell.get_temperature() == 200.0
|
||||
assert cell.get_temperature() == pytest.approx(200.0)
|
||||
|
||||
|
||||
def test_new_cell(lib_init):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue