浏览代码

Merge pull request #1470 from Unity-Technologies/release-v0.6-make-test-directory-agnostic

made the pytest directory agnostic
/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
b946047a
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 4
      ml-agents/tests/trainers/test_demo_loader.py
  2. 4
      ml-agents/tests/trainers/test_trainer_controller.py

4
ml-agents/tests/trainers/test_demo_loader.py


import unittest.mock as mock
import pytest
import os
brain_parameters, brain_infos, total_expected = load_demonstration('./tests/trainers/test.demo')
path_prefix = os.path.dirname(os.path.abspath(__file__))
brain_parameters, brain_infos, total_expected = load_demonstration(path_prefix+'/test.demo')
assert (brain_parameters.brain_name == "Ball3DBrain")
assert (brain_parameters.vector_observation_space_size == 8)
assert (len(brain_infos) == total_expected)

4
ml-agents/tests/trainers/test_trainer_controller.py


import json
import unittest.mock as mock
import os
import yaml
import pytest

'''
default:
trainer: offline_bc
demo_path: ./tests/trainers/test.demo
demo_path: '''
+ os.path.dirname(os.path.abspath(__file__)) + '''/test.demo
batches_per_epoch: 16
batch_size: 32
beta: 5.0e-3

正在加载...
取消
保存