From f3ffa714cbd0a86221951367eae7108b1f9d708a Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 14 Aug 2023 16:09:28 +0200 Subject: [PATCH] Cleaning up test/test_dmc_envs.py --- test/test_dmc_envs.py | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/test/test_dmc_envs.py b/test/test_dmc_envs.py index 3888f59..7a96d94 100644 --- a/test/test_dmc_envs.py +++ b/test/test_dmc_envs.py @@ -7,47 +7,31 @@ import pytest import fancy_gym from test.utils import run_env, run_env_determinism -# SUITE_IDS = [f'dmc:{env}-{task}' for env, task in suite.ALL_TASKS if env != "lqr"] -# MANIPULATION_IDS = [f'dmc:manipulation-{task}' for task in manipulation.ALL if task.endswith('_features')] -DM_CONTROL_IDS = [spec.id for spec in gym.envs.registry.values() if +DMC_IDS = [spec.id for spec in gym.envs.registry.values() if spec.id.startswith('dm_control/') and 'compatibility-env-v0' not in spec.id and 'lqr-lqr' not in spec.id] -DM_control_MP_IDS = list(chain(*fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS.values())) +DMC_MP_IDS = list(chain(*fancy_gym.ALL_DMC_MOVEMENT_PRIMITIVE_ENVIRONMENTS.values())) SEED = 1 -@pytest.mark.parametrize('env_id', DM_CONTROL_IDS) +@pytest.mark.parametrize('env_id', DMC_IDS) def test_step_dm_control_functionality(env_id: str): """Tests that suite step environments run without errors using random actions.""" run_env(env_id, 5000, wrappers=[gym.wrappers.FlattenObservation]) -@pytest.mark.parametrize('env_id', DM_CONTROL_IDS) +@pytest.mark.parametrize('env_id', DMC_IDS) def test_step_dm_control_determinism(env_id: str): """Tests that for step environments identical seeds produce identical trajectories.""" run_env_determinism(env_id, SEED, 5000, wrappers=[gym.wrappers.FlattenObservation]) - -# @pytest.mark.parametrize('env_id', MANIPULATION_IDS) -# def test_step_manipulation_functionality(env_id: str): -# """Tests that manipulation step environments run without errors using random actions.""" -# run_env(env_id) -# -# -# @pytest.mark.parametrize('env_id', MANIPULATION_IDS) -# def test_step_manipulation_determinism(env_id: str): -# """Tests that for step environments identical seeds produce identical trajectories.""" -# run_env_determinism(env_id, SEED) - - -@pytest.mark.parametrize('env_id', DM_control_MP_IDS) +@pytest.mark.parametrize('env_id', DMC_MP_IDS) def test_bb_dmc_functionality(env_id: str): """Tests that black box environments run without errors using random actions.""" run_env(env_id) - -@pytest.mark.parametrize('env_id', DM_control_MP_IDS) +@pytest.mark.parametrize('env_id', DMC_MP_IDS) def test_bb_dmc_determinism(env_id: str): """Tests that for black box environment identical seeds produce identical trajectories.""" run_env_determinism(env_id, SEED)