Skip to content

Commit a37b2bf

Browse files
committed
macos-14 tolerance
1 parent 3c82262 commit a37b2bf

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_morphio.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ def quadratic(x, y, a0, a1, a2):
217217
with open(tmp_path.joinpath("funcy_target.cgr")) as gf:
218218
generated = filter(ignore_path, gf)
219219
target = filter(ignore_path, tf)
220-
for x, y in zip(generated, target):
221-
assert x == y
222-
assert all(x == y for x, y in zip(generated, target))
220+
for m, t in zip(generated, target):
221+
m_row = m.split()
222+
t_row = t.split()
223+
assert len(m_row) == len(t_row)
224+
for idx, _ in enumerate(m_row):
225+
if isfloat(m_row[idx]) and isfloat(t_row[idx]):
226+
assert np.isclose(
227+
float(m_row[idx]), float(t_row[idx])
228+
)
229+
else:
230+
assert m_row[idx] == t_row[idx]

0 commit comments

Comments
 (0)