mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-01 06:07:08 +00:00
* Remove additional ignores from flake8 * Remove all unused imports * Remove all unused imports * Update flake8 and pyupgrade * F841, removed unused variables * E731, removed lambda assignment to variables * Remove E731, F403, F405, F524 * Remove E722, bare exceptions * Remove E712, compare variable == True or == False to is True or is False * Remove E402, module level import not at top of file * Added --pre-file-ignores * Add --per-file-ignores removing E741, E302 and E704 * Add E741, do not use variables named ‘l’, ‘O’, or ‘I’ to ignore issues in classic control * Fixed issues for pytest==6.2 * Remove unnecessary # noqa * Edit comment with the removal of E302 * Added warnings and declared module, attr for pyright type hinting * Remove unused import * Removed flake8 E302 * Updated flake8 from 3.9.2 to 4.0.1 * Remove unused variable
20 lines
570 B
Python
20 lines
570 B
Python
import pytest
|
|
|
|
from gym import envs
|
|
from tests.envs.spec_list import SKIP_MUJOCO_WARNING_MESSAGE, skip_mujoco
|
|
|
|
ENVIRONMENT_IDS = ("HalfCheetah-v2",)
|
|
|
|
|
|
@pytest.mark.skipif(skip_mujoco, reason=SKIP_MUJOCO_WARNING_MESSAGE)
|
|
@pytest.mark.parametrize("environment_id", ENVIRONMENT_IDS)
|
|
def test_serialize_deserialize(environment_id):
|
|
env = envs.make(environment_id)
|
|
env.reset()
|
|
|
|
with pytest.raises(ValueError, match="Action dimension mismatch"):
|
|
env.step([0.1])
|
|
|
|
with pytest.raises(ValueError, match="Action dimension mismatch"):
|
|
env.step(0.1)
|