From 2e49e22f21eae231f9a5f6e3715dd1403668b8a4 Mon Sep 17 00:00:00 2001 From: Kai Fricke Date: Fri, 4 Sep 2020 17:09:02 +0100 Subject: [PATCH] [tune] Add test_sample to bazel BUILD (#10566) --- python/ray/tune/BUILD | 8 ++++++++ python/ray/tune/tests/test_sample.py | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/python/ray/tune/BUILD b/python/ray/tune/BUILD index 36303e6de..d24cf0452 100644 --- a/python/ray/tune/BUILD +++ b/python/ray/tune/BUILD @@ -147,6 +147,14 @@ py_test( tags = ["exclusive"], ) +py_test( + name = "test_sample", + size = "medium", + srcs = ["tests/test_sample.py"], + deps = [":tune_lib"], + tags = ["exclusive"], +) + py_test( name = "test_sync", size = "medium", diff --git a/python/ray/tune/tests/test_sample.py b/python/ray/tune/tests/test_sample.py index 63080f06b..dee68fe83 100644 --- a/python/ray/tune/tests/test_sample.py +++ b/python/ray/tune/tests/test_sample.py @@ -304,12 +304,10 @@ class SearchSpaceTest(unittest.TestCase): ] sampler1 = RandomSampler(seed=1234) - searcher1 = OptunaSearch( - space=converted_config, sampler=sampler1, base_config=config) + searcher1 = OptunaSearch(space=converted_config, sampler=sampler1) sampler2 = RandomSampler(seed=1234) - searcher2 = OptunaSearch( - space=optuna_config, sampler=sampler2, base_config=config) + searcher2 = OptunaSearch(space=optuna_config, sampler=sampler2) config1 = searcher1.suggest("0") config2 = searcher2.suggest("0") @@ -317,7 +315,6 @@ class SearchSpaceTest(unittest.TestCase): self.assertEqual(config1, config2) self.assertIn(config1["a"], [2, 3, 4]) self.assertIn(config1["b"]["x"], list(range(5))) - self.assertEqual(config1["b"]["y"], 4) self.assertLess(1e-4, config1["b"]["z"]) self.assertLess(config1["b"]["z"], 1e-2)