Skip to content

Commit

Permalink
moved python script to testing folder
Browse files Browse the repository at this point in the history
  • Loading branch information
John Platt authored and jdplatt committed Feb 26, 2019
1 parent 7235302 commit 7ba9240
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
6 changes: 0 additions & 6 deletions pkg/suggestion/.coveragerc

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/suggestion/python_tests.sh

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/suggestion/tests/study_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parameter_configs:
- 2
- 3
- 5
- parameter_type: 4 # Code for DISCRETE
- parameter_type: 4 # Code for CATEGORICAL
name: "fake_categorical"
feasible:
list:
Expand Down
8 changes: 6 additions & 2 deletions pkg/suggestion/tests/test_algorithm_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import yaml
import pytest
import numpy as np
Expand All @@ -7,17 +9,19 @@
from ..bayesianoptimization.src.algorithm_manager import AlgorithmManager


TEST_DIR = os.path.dirname(os.path.realpath(__file__))


@pytest.fixture
def study_config():
with open("tests/study_config.yaml", "r", encoding="utf-8") as f:
with open(os.path.join(TEST_DIR, "study_config.yaml"), "r") as f:
contents = yaml.safe_load(f)
return Box(contents)


@pytest.fixture
def observations():
with open("tests/parameter_values.yaml", "r", encoding="utf-8") as f:
with open(os.path.join(TEST_DIR, "parameter_values.yaml"), "r") as f:
contents = yaml.safe_load(f)
return Box(contents)

Expand Down
5 changes: 5 additions & 0 deletions test/scripts/python_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pip install -r cmd/suggestion/bayesianoptimization/requirements.txt
pip install -r pkg/suggestion/test_requirements.txt
python setup.py develop
pylint pkg/suggestion/bayesianoptimization/src --disable=fixme --exit-zero --reports=y
pytest pkg/suggestion/tests --verbose --cov=pkg/suggestion/bayesianoptimization/src --cov-report term-missing

0 comments on commit 7ba9240

Please sign in to comment.