Skip to content

Commit dc3ac6c

Browse files
committed
fix broken tests
Signed-off-by: DONNOT Benjamin <[email protected]>
1 parent 8ca9834 commit dc3ac6c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

grid2op/Observation/baseObservation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,8 @@ def _aux_process_grid2op_compat_1_11_0(cls):
13391339
"load_q_detached",
13401340
"gen_p_detached",
13411341
"storage_p_detached",
1342+
# protection (>= 1.11.0)
1343+
"timestep_protection_engaged"
13421344
]:
13431345
try:
13441346
cls.attr_list_vect.remove(el)

grid2op/tests/test_basic_env_ls.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from grid2op.Agent import RandomAgent
3030
from grid2op.tests.helper_path_test import data_test_dir
3131
from grid2op.Episode import EpisodeData
32+
from grid2op.Exceptions import Grid2OpException
3233

3334
try:
3435
from lightsim2grid import LightSimBackend
@@ -174,7 +175,7 @@ def test_backward_compatibility(self):
174175
"1.10.3",
175176
"1.10.4",
176177
"1.10.5",
177-
"1.10.5.post1",
178+
# "1.10.5.post1", # missing from the data stored apparently
178179
]
179180
# first check a normal run
180181
curr_version = "test_version"
@@ -241,7 +242,10 @@ def _aux_backward(self, base_path, g2op_version_txt, g2op_version):
241242
assert "curtailment" in CompleteObservation.attr_list_vect, (
242243
f"error after the legacy version " f"{g2op_version}"
243244
)
244-
this_episode = EpisodeData.from_disk(base_path, episode_path)
245+
try:
246+
this_episode = EpisodeData.from_disk(base_path, episode_path)
247+
except Grid2OpException as exc_:
248+
raise AssertionError(f"Impossible to load version {g2op_version}")
245249
assert "curtailment" in CompleteObservation.attr_list_vect, (
246250
f"error after the legacy version " f"{g2op_version}"
247251
)

0 commit comments

Comments
 (0)