Skip to content

Commit

Permalink
Need to assert arrays as *almost* equal, not just equal
Browse files Browse the repository at this point in the history
  • Loading branch information
rgoj committed Oct 30, 2012
1 parent df86ef9 commit 0f1d01e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test_lead_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from nose import with_setup
from numpy import array_equal
from numpy.testing import assert_array_almost_equal

from lead_field import calculate_lead_field

Expand All @@ -18,4 +19,4 @@ def test_lead_field_same_output_as_old_code():
global old_code
for i in range(len(old_code)):
lead_field = calculate_lead_field(old_code[i]['gen_conf'])
assert array_equal(lead_field, old_code[i]['lead_field'])
assert_array_almost_equal(lead_field, old_code[i]['lead_field'], 17)

0 comments on commit 0f1d01e

Please sign in to comment.