fix pyright.TypeIssues in test_mujoco_custom_env.py (#599)

This commit is contained in:
Kallinteris Andreas
2023-07-11 01:27:36 +03:00
committed by GitHub
parent 1d305e1214
commit ee067c721b

View File

@@ -111,12 +111,14 @@ def test_frame_skip(frame_skip):
def test_xml_file(): def test_xml_file():
"""Verify that the loading of a custom XML file works""" """Verify that the loading of a custom XML file works"""
relative_path = "./tests/envs/mujoco/assets/walker2d_v5_uneven_feet.xml" relative_path = "./tests/envs/mujoco/assets/walker2d_v5_uneven_feet.xml"
env = PointEnv(xml_file=relative_path) env = PointEnv(xml_file=relative_path).unwrapped
assert env.unwrapped.data.qpos.size == 9 assert isinstance(env, MujocoEnv)
assert env.data.qpos.size == 9
full_path = os.getcwd() + "/tests/envs/mujoco/assets/walker2d_v5_uneven_feet.xml" full_path = os.getcwd() + "/tests/envs/mujoco/assets/walker2d_v5_uneven_feet.xml"
env = PointEnv(xml_file=full_path) env = PointEnv(xml_file=full_path).unwrapped
assert env.unwrapped.data.qpos.size == 9 assert isinstance(env, MujocoEnv)
assert env.data.qpos.size == 9
# note can not test user home path (with '~') because github CI does not have a home folder # note can not test user home path (with '~') because github CI does not have a home folder