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 e413b4f commit 835a31a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,13 @@ def test_write_to_Rt_file(self, mock_mkdir, time=1):
test_sim.write_to_Rt_file(np.array([1]))
calls = mock_write.call_args_list
# Need to use np.testing for the NaNs
np.testing.assert_equal(calls[0].args[0], dict_1)
# 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]
for key in dict_1:
self.assertTrue(key in actual_dict)
np.testing.assert_array_equal(dict_1[key],
actual_dict[key])
self.assertDictEqual(calls[1].args[0], dict_2)
self.assertEqual(mock_write.call_count, 2)
mock_mkdir.assert_called_with(
Expand Down

0 comments on commit 835a31a

Please sign in to comment.