Skip to content

Commit

Permalink
ENH check for injection of runhistory as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeurer committed Oct 5, 2016
1 parent e581b9d commit cbafd7b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test_facade/test_smac_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

from smac.configspace import ConfigurationSpace

from smac.runhistory.runhistory import RunHistory
from smac.facade.smac_facade import SMAC
from smac.scenario.scenario import Scenario
from smac.stats.stats import Stats
from smac.tae.execute_func import ExecuteTAFunc


Expand All @@ -13,8 +15,10 @@ def setUp(self):
self.cs = ConfigurationSpace()
self.scenario = Scenario({'cs': self.cs, 'run_obj': 'quality'})

def test_inject_stats_object_to_TAE(self):
def test_inject_stats_and_runhistory_object_to_TAE(self):
ta = ExecuteTAFunc(lambda x: x**2)
self.assertIsNone(ta.stats)
self.assertIsNone(ta.runhistory)
SMAC(tae_runner=ta, scenario=self.scenario)
self.assertIsNotNone(ta.stats)
self.assertIsInstance(ta.stats, Stats)
self.assertIsInstance(ta.runhistory, RunHistory)

0 comments on commit cbafd7b

Please sign in to comment.