Skip to content

Commit

Permalink
chore: Update env_test.py to handle termination and truncation in tes…
Browse files Browse the repository at this point in the history
…t_can_simulate_with_pedestrians()
  • Loading branch information
ll7 committed Sep 23, 2024
1 parent 0e46529 commit defd7a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/env_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

0 comments on commit defd7a5

Please sign in to comment.