From 49ac9c378571e78c26833a25edbd3f24fb62c0a1 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 18 Jun 2023 11:53:10 +0200 Subject: [PATCH] Fix: Don't throw errors for envs, that do not expose a max_episode_steps. --- test/test_black_box.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_black_box.py b/test/test_black_box.py index 678eaa9..61926cf 100644 --- a/test/test_black_box.py +++ b/test/test_black_box.py @@ -115,6 +115,11 @@ def test_verbosity(mp_type: str, env_wrap: Tuple[str, Type[RawInterfaceWrapper]] @pytest.mark.parametrize('mp_type', ['promp', 'dmp', 'prodmp']) @pytest.mark.parametrize('env_wrap', zip(ENV_IDS, WRAPPERS)) def test_length(mp_type: str, env_wrap: Tuple[str, Type[RawInterfaceWrapper]]): + if not env.spec.max_episode_steps: + # Not all envs expose a max_episode_steps. + # To use those with MPs, they could be put in a time_limit-wrapper. + return True + basis_generator_type = 'prodmp' if mp_type == 'prodmp' else 'rbf' env_id, wrapper_class = env_wrap