Passed
Push — master ( 82152a...125377 )
by Simon
04:39
created

tests.test_optimizers.test_names.test_name_0()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
import time
2
import pytest
3
import numpy as np
4
5
from ._parametrize import optimizers
6
7
8
def objective_function(para):
9
    score = -para["x1"] * para["x1"]
10
    return score
11
12
13
search_space = {
14
    "x1": np.arange(0, 100, 1),
15
}
16
17
18
@pytest.mark.parametrize(*optimizers)
19
def test_name_0(Optimizer):
20
    opt = Optimizer(search_space)
21
22
    opt.name
23
24
25
@pytest.mark.parametrize(*optimizers)
26
def test_name_1(Optimizer):
27
    opt = Optimizer(search_space)
28
29
    opt._name_
30