Skip to content

Commit

Permalink
Updated test_simulation.py to (hopefully) work with python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mghosh00 committed Mar 7, 2024
1 parent 9b1b64f commit d46c1e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import random
import numpy as np
import unittest
Expand Down Expand Up @@ -579,7 +580,10 @@ def test_write_to_Rt_file(self, mock_mkdir, time=1):
# Need to use np.testing for the NaNs
# Need to test keys and values separately in case we are using
# python 3.7 (for which np.testing.assert_equal will not work)
actual_dict = calls[0].args[0]
if sys.version_info[1] <= 7:
actual_dict = calls[0].args
else:
actual_dict = calls[0].args[0]
for key in dict_1:
self.assertTrue(key in actual_dict.keys())
np.testing.assert_array_equal(dict_1[key],
Expand Down

0 comments on commit d46c1e8

Please sign in to comment.