@@ -0,0 +1,1108 @@
+from sklearn.utils.testing import assert_almost_equal%0Afrom sklearn.utils.testing import assert_array_less%0Afrom sklearn.utils.testing import assert_array_equal%0Afrom sklearn.utils.testing import assert_equal%0A%0Afrom skopt.benchmarks import branin%0Afrom skopt.tests.test_tree_opt import MINIMIZERS as TREE_MINIMIZERS%0A%0AMINIMIZERS = %5B%5D%0AMINIMIZERS += TREE_MINIMIZERS%0A%0A%0Adef check_minimizer_api(result):%0A    assert_equal(len(result.models), 4)%0A    assert_array_equal(result.x_iters.shape, (7, 2))%0A    assert_array_equal(result.func_vals.shape, (7,))%0A    assert_array_equal(result.x, result.x_iters%5Bnp.argmin(result.func_vals)%5D)%0A    assert_almost_equal(result.fun, branin(result.x))%0A%0A%0Adef check_minimizer_bounds(result):%0A    assert_array_less(result.x_iters, np.tile(%5B10, 15%5D, (7, 1)))%0A    assert_array_less(np.tile(%5B-5, 0%5D, (7, 1)), result.x_iters)%0A%0A%0Adef test_minimizer_api():%0A    for minimizer in MINIMIZERS:%0A        result = minimizer(branin, %5B(-5.0, 10.0), (0.0, 15.0)%5D,%0A                           n_random_starts=3, n_calls=7,%0A                           random_state=1)%0A%0A        yield (check_minimizer_api, result)%0A

Create common tests