From c6962a17313d3e75b6a5ed5900f10aa8bc59e501 Mon Sep 17 00:00:00 2001 From: Xavier Weiss Date: Fri, 8 Nov 2024 20:01:58 +0100 Subject: [PATCH] Test: Update ObsDim gym_compat Signed-off-by: Xavier Weiss --- grid2op/tests/_aux_test_gym_compat.py | 3 ++- grid2op/tests/test_alert_gym_compat.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/grid2op/tests/_aux_test_gym_compat.py b/grid2op/tests/_aux_test_gym_compat.py index 6f574b37..87c85e64 100644 --- a/grid2op/tests/_aux_test_gym_compat.py +++ b/grid2op/tests/_aux_test_gym_compat.py @@ -153,7 +153,8 @@ def test_convert_togym(self): for el in env_gym.observation_space.spaces ] ) - size_th = 536 # as of grid2Op 1.7.1 (where all obs attributes are there) + size_th = 558 # as of grid2Op 1.7.1 (where all obs attributes are there) + # as of grid2op 1.11.0 (where flexibility was added) assert ( dim_obs_space == size_th ), f"Size should be {size_th} but is {dim_obs_space}" diff --git a/grid2op/tests/test_alert_gym_compat.py b/grid2op/tests/test_alert_gym_compat.py index ce3a74e8..cbf8f578 100644 --- a/grid2op/tests/test_alert_gym_compat.py +++ b/grid2op/tests/test_alert_gym_compat.py @@ -116,7 +116,8 @@ def test_print_alert(self): act = self.env.action_space() act.raise_alert = [2] act_gym = env_gym.action_space.to_gym(act) - act_str = act_gym.__str__() + act_str = act_gym.__str__() + # NOTE: This Str Comparison may fail locally due to changes in OrderDict formatting (rely on CI if in doubt) assert act_str == ("OrderedDict([('change_bus', array([False, False, False, False, False, False, False, False, False," "\n False, False, False, False, False, False, False, False, False,\n " "False, False, False, False, False, False, False, False, False,\n False, False, False, "