Skip to content

Commit

Permalink
Declare anytree onn top to pass test_is_constant_and_can_evaluate
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Nov 9, 2023
1 parent 8d6db99 commit 700ab5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/unit/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

def test_function(arg):
return arg + arg

anytree = sys.modules['anytree']
class TestUtil(TestCase):
"""
Test the functionality in util.py
Expand All @@ -31,6 +33,7 @@ def test_rmse(self):
pybamm.rmse(np.ones(5), np.zeros(3))

def test_is_constant_and_can_evaluate(self):
sys.modules['anytree'] = anytree
symbol = pybamm.PrimaryBroadcast(0, "negative electrode")
self.assertEqual(False, pybamm.is_constant_and_can_evaluate(symbol))
symbol = pybamm.StateVector(slice(0, 1))
Expand Down

0 comments on commit 700ab5a

Please sign in to comment.