Skip to content

Commit

Permalink
Maybe fixed test on Ubuntu
Browse files Browse the repository at this point in the history
A dictionary might be changed in an unexpected way.
  • Loading branch information
mnwhite committed Aug 19, 2024
1 parent df6784e commit 7511efe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions HARK/ConsumptionSaving/tests/test_ConsMarkovModel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
from copy import copy
from copy import deepcopy

import numpy as np

Expand Down Expand Up @@ -56,7 +56,7 @@ def setUp(self):
]
)

init_serial_unemployment = copy(init_indshk_markov)
init_serial_unemployment = deepcopy(init_indshk_markov)
init_serial_unemployment["MrkvArray"] = [MrkvArray]
init_serial_unemployment["UnempPrb"] = np.zeros(2)
# Income process is overwritten below to make income distribution when employed
Expand Down Expand Up @@ -224,3 +224,7 @@ def main_test(self):
self.assertAlmostEqual(
Markov_vFuncBool_example.solution[0].vFunc[1](0.4), -4.12794
)

if __name__ == "__main__":
# Run all the tests
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ def test_simulation(self):
self.tct.history["mLvl"][15][0] - self.tct.history["cLvlNow"][15][0],
self.tct.history["aLvl"][15][0],
)

if __name__ == "__main__":
# Run all the tests
unittest.main()

0 comments on commit 7511efe

Please sign in to comment.