mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-23 15:04:20 +00:00
Test refactoring (#2427)
* Move tests to root with automatic PyCharm import refactoring. This will likely fail some tests * Changed entry point for a registration test env. * Move a stray lunar_lander test to tests/envs/... * black * Change the version from which importlib_metadata is replaced with importlib.metadata. Also requiring installing importlib_metadata for python 3.8 now. ??????????? * Undo last commit
This commit is contained in:
committed by
GitHub
parent
ca42b05243
commit
947b857bd4
26
tests/envs/robotics/hand/test_manipulate.py
Normal file
26
tests/envs/robotics/hand/test_manipulate.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import pickle
|
||||
|
||||
import pytest
|
||||
|
||||
from gym import envs
|
||||
from tests.envs.spec_list import skip_mujoco, SKIP_MUJOCO_WARNING_MESSAGE
|
||||
|
||||
|
||||
ENVIRONMENT_IDS = (
|
||||
"HandManipulateEgg-v0",
|
||||
"HandManipulatePen-v0",
|
||||
"HandManipulateBlock-v0",
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(skip_mujoco, reason=SKIP_MUJOCO_WARNING_MESSAGE)
|
||||
@pytest.mark.parametrize("environment_id", ENVIRONMENT_IDS)
|
||||
def test_serialize_deserialize(environment_id):
|
||||
env1 = envs.make(environment_id, target_position="fixed")
|
||||
env1.reset()
|
||||
env2 = pickle.loads(pickle.dumps(env1))
|
||||
|
||||
assert env1.target_position == env2.target_position, (
|
||||
env1.target_position,
|
||||
env2.target_position,
|
||||
)
|
Reference in New Issue
Block a user