From defd7a5160044c6179ee04fea3e69a97b19c0113 Mon Sep 17 00:00:00 2001 From: Lennart Luttkus Date: Mon, 23 Sep 2024 08:38:35 +0200 Subject: [PATCH] chore: Update env_test.py to handle termination and truncation in test_can_simulate_with_pedestrians() --- tests/env_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/env_test.py b/tests/env_test.py index db926e9..c14609d 100644 --- a/tests/env_test.py +++ b/tests/env_test.py @@ -13,7 +13,7 @@ def test_can_return_valid_observation(): drive_state_spec: spaces.Box = env.observation_space[OBS_DRIVE_STATE] lidar_state_spec: spaces.Box = env.observation_space[OBS_RAYS] - obs = env.reset() + obs, info = env.reset() assert isinstance(obs, dict) assert OBS_DRIVE_STATE in obs and OBS_RAYS in obs @@ -27,6 +27,7 @@ def test_can_simulate_with_pedestrians(): env.reset() for _ in range(total_steps): rand_action = env.action_space.sample() - _, _, done, _ = env.step(rand_action) + _, _, terminated, truncated, _ = env.step(rand_action) + done = terminated or truncated if done: env.reset()