diff --git a/pyEpiabm/pyEpiabm/tests/test_unit/test_routine/test_simulation.py b/pyEpiabm/pyEpiabm/tests/test_unit/test_routine/test_simulation.py index 2af1f4c79..40087ac56 100644 --- a/pyEpiabm/pyEpiabm/tests/test_unit/test_routine/test_simulation.py +++ b/pyEpiabm/pyEpiabm/tests/test_unit/test_routine/test_simulation.py @@ -595,7 +595,8 @@ 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) - if sys.version_info[0] >= 3 or sys.version_info[1] >= 8: + major, minor = sys.version_info[0], sys.version_info[1] + if major >= 4 or (major == 3 and minor >= 8): actual_dict_1 = calls[0].args[0] for key in dict_1: self.assertTrue(key in actual_dict_1)