Skip to content

Commit

Permalink
test: Skip v2.0 on ARM processor
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhart committed Dec 16, 2024
1 parent 1aa3184 commit e79ae7b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions wntr/tests/test_epanet_toolkit.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import unittest
from os.path import abspath, dirname, join, exists
import sys, platform

import wntr.epanet.toolkit

if 'darwin' in sys.platform.lower() and 'arm' in platform.platform().lower():
skip_v2_tests_on_arm = True
else:
skip_v2_tests_on_arm = False

testdir = dirname(abspath(__file__))
datadir = join(testdir, "..", "..", "examples", "networks")

Expand All @@ -11,6 +17,8 @@ class TestEpanetToolkit(unittest.TestCase):

def test_isOpen(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
self.assertEqual(0, enData.isOpen())
Expand All @@ -19,6 +27,8 @@ def test_isOpen(self):

def test_ENgetcount(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
enData.ENopen(enData.inpfile, "temp.rpt")
Expand All @@ -30,6 +40,8 @@ def test_ENgetcount(self):

def test_ENgetflowunits(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
enData.ENopen(enData.inpfile, "temp.rpt")
Expand All @@ -39,6 +51,8 @@ def test_ENgetflowunits(self):

def test_EN_timeparam(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
enData.ENopen(enData.inpfile, "temp.rpt")
Expand All @@ -51,6 +65,8 @@ def test_EN_timeparam(self):

def test_ENgetindex_ENgetvalue(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
enData.ENopen(enData.inpfile, "temp.rpt")
Expand All @@ -74,6 +90,8 @@ def test_ENgetindex_ENgetvalue(self):

def test_ENsaveinpfile(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
enData.ENopen(enData.inpfile, "temp.rpt")
Expand All @@ -94,6 +112,8 @@ def test_runepanet(self):

def test_runepanet_step(self):
for version in [2.0, 2.2,]:
if version == 2.0 and skip_v2_tests_on_arm:
continue # skip v2.0 tests on mac silicon processor
enData = wntr.epanet.toolkit.ENepanet(version=version)
enData.inpfile = join(datadir, "Net1.inp")
enData.ENopen(enData.inpfile, "temp_runepanet_step.rpt", "temp_runepanet_step.bin")
Expand Down

0 comments on commit e79ae7b

Please sign in to comment.