Skip to content

Commit bef8fe2

Browse files
author
Sam Rensenhouse
committed
changing test to allow for floating point differences
1 parent 283e17f commit bef8fe2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

owa-epanet/test/test_owa_epanet.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ def test_water_age_sim():
236236
en.closeQ(ph=epanet_proj)
237237
en.closeH(ph=epanet_proj)
238238
en.close(ph=epanet_proj)
239-
assert age_list[26] == [1.0, 2.2141675704376946, 12.939125434025273, 24.44152992466322, 13.174235412569542,
240-
24.441519659540887, 15.679376648181817, 21.97064181429266, 19.048343501261524, 1.0]
239+
assert age_list[26] == pytest.approx(
240+
[1.0, 2.2141675704376946, 12.939125434025273, 24.44152992466322, 13.174235412569542,
241+
24.441519659540887, 15.679376648181817, 21.97064181429266, 19.048343501261524, 1.0])
241242
clean_dir()
242243

243244

@@ -324,6 +325,7 @@ def test_setnodevalue():
324325
assert tank_level_list ==[121.0]
325326
clean_dir()
326327

328+
327329
def test_setcurve():
328330
def make_array(values):
329331
dbl_arr = en.doubleArray(len(values))
@@ -341,6 +343,7 @@ def make_array(values):
341343
count = en.getcurvelen(ph=epanet_proj, index=curve_index)
342344
assert count == 5
343345

346+
344347
def test_coords():
345348
epanet_proj = en.createproject()
346349
en.open(ph=epanet_proj, inpFile=example_1_path, rptFile='report.rpt', outFile='output.out')

0 commit comments

Comments
 (0)