浏览代码

Patch communicator in test to prevent port reservation

A test in `test_envs.py` launched a UnityEnvironment without mocking
the created communicator, leading to a port being reserved during the
test run.  This in turn caused failures in later tests of
RpcCommunicator.  This commit fixes that issue.
/develop-generalizationTraining-TrainerController
Jonathan Harper 6 年前
当前提交
35f06d90
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      ml-agents/tests/envs/test_envs.py

4
ml-agents/tests/envs/test_envs.py


BrainInfo
from tests.mock_communicator import MockCommunicator
def test_handles_bad_filename():
@mock.patch('mlagents.envs.UnityEnvironment.get_communicator')
def test_handles_bad_filename(get_communicator):
with pytest.raises(UnityEnvironmentException):
UnityEnvironment(' ')

正在加载...
取消
保存