From 50664d953b0f51a27b46aee9f7ca5b2eab40d214 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 29 Oct 2023 13:55:46 +0100 Subject: [PATCH 1/3] Better implementation of blacklist to only test gym builtin --- ...test_all_gym_builtin_envs.py => test_gym_builtin_envs.py} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename test/{test_all_gym_builtin_envs.py => test_gym_builtin_envs.py} (90%) diff --git a/test/test_all_gym_builtin_envs.py b/test/test_gym_builtin_envs.py similarity index 90% rename from test/test_all_gym_builtin_envs.py rename to test/test_gym_builtin_envs.py index f2eeac6..e131c52 100644 --- a/test/test_all_gym_builtin_envs.py +++ b/test/test_gym_builtin_envs.py @@ -12,12 +12,15 @@ GYM_IDS = [spec.id for spec in gym.envs.registry.values() if not isinstance(spec.entry_point, Callable) and "fancy_gym" not in spec.entry_point and 'make_bb_env_helper' not in spec.entry_point and 'jax' not in spec.id.lower() - and 'jax' not in spec.id.lower() + and 'shimmy' not in spec.id.lower() + and 'ale_py' not in spec.id.lower() + and 'tabular' not in spec.id.lower() and not re.match(r'GymV2.Environment', spec.id) ] GYM_MP_IDS = fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS['all'] SEED = 1 +print(GYM_IDS) @pytest.mark.parametrize('env_id', GYM_IDS) def test_step_gym_functionality(env_id: str): From b4128ff6d9f7865ca08c6aeece1817b457d18b40 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 29 Oct 2023 15:21:41 +0100 Subject: [PATCH 2/3] Fix: Typo in test_black_box leads to incorrect testing --- test/test_black_box.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_black_box.py b/test/test_black_box.py index 8cdc543..419691f 100644 --- a/test/test_black_box.py +++ b/test/test_black_box.py @@ -103,7 +103,7 @@ def test_verbosity(mp_type: str, env_wrap: Tuple[str, Type[RawInterfaceWrapper]] env_step = make(env_id) env_step.reset() - _obs, _reward, _terminated, _truncated, info = env.step(env.action_space.sample()) + _obs, _reward, _terminated, _truncated, info = env_step.step(env_step.action_space.sample()) info_keys_step = info.keys() assert all(e in info_keys for e in info_keys_step) From c8b79d276da2fa51ccf676ebb75c4a0367e5cdc2 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 29 Oct 2023 15:41:28 +0100 Subject: [PATCH 3/3] remove forgotten print statement --- test/test_gym_builtin_envs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_gym_builtin_envs.py b/test/test_gym_builtin_envs.py index e131c52..efde6fa 100644 --- a/test/test_gym_builtin_envs.py +++ b/test/test_gym_builtin_envs.py @@ -20,8 +20,6 @@ GYM_IDS = [spec.id for spec in gym.envs.registry.values() if GYM_MP_IDS = fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS['all'] SEED = 1 -print(GYM_IDS) - @pytest.mark.parametrize('env_id', GYM_IDS) def test_step_gym_functionality(env_id: str): """Tests that step environments run without errors using random actions."""