浏览代码

Adding test for bad env_path on create_environment_factory

/asymm-envs
Alphonso Crawford 5 年前
当前提交
802593a2
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11
      ml-agents/mlagents/trainers/tests/test_learn.py

11
ml-agents/mlagents/trainers/tests/test_learn.py


from mlagents.trainers import learn
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.learn import parse_command_line
from mlagents_envs.exception import UnityEnvironmentException
def basic_options(extra_args=None):

mock_init.assert_called_once()
assert mock_init.call_args[0][1] == "/dockertarget/models/ppo"
assert mock_init.call_args[0][2] == "/dockertarget/summaries"
def test_bad_env_path():
with pytest.raises(UnityEnvironmentException):
learn.create_environment_factory(env_path="/foo/bar",
docker_target_name=None,
no_graphics=True,
seed=None,
start_port=8000,
env_args=None)
@patch("builtins.open", new_callable=mock_open, read_data="{}")

正在加载...
取消
保存