Skip to content

Commit e042b2e

Browse files
committed
test: improve parameter naming
1 parent 9f021cb commit e042b2e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/strategy/test_strategy_parameters.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ def test_hyperopt_decimal_parameter():
7373
with pytest.raises(OperationalException, match=r"DecimalParameter space invalid\."):
7474
DecimalParameter([0, 10], high=7, default=5, space="buy")
7575

76-
fltpar = DecimalParameter(low=0.0, high=0.5, default=0.14, decimals=1, space="buy")
77-
assert fltpar.value == 0.1
78-
assert isinstance(fltpar.get_space(""), SKDecimal)
79-
assert isinstance(fltpar.range, list)
80-
assert len(list(fltpar.range)) == 1
76+
decimalpar = DecimalParameter(low=0.0, high=0.5, default=0.14, decimals=1, space="buy")
77+
assert decimalpar.value == 0.1
78+
assert isinstance(decimalpar.get_space(""), SKDecimal)
79+
assert isinstance(decimalpar.range, list)
80+
assert len(list(decimalpar.range)) == 1
8181
# Range contains ONLY the default / value.
82-
assert list(fltpar.range) == [fltpar.value]
83-
fltpar.in_space = True
84-
assert len(list(fltpar.range)) == 6
85-
assert list(fltpar.range) == [0.0, 0.1, 0.2, 0.3, 0.4, 0.5]
82+
assert list(decimalpar.range) == [decimalpar.value]
83+
decimalpar.in_space = True
84+
assert len(list(decimalpar.range)) == 6
85+
assert list(decimalpar.range) == [0.0, 0.1, 0.2, 0.3, 0.4, 0.5]
8686

8787
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
88-
assert len(list(fltpar.range)) == 1
88+
assert len(list(decimalpar.range)) == 1
8989

9090

9191
def test_hyperopt_categorical_parameter():

0 commit comments

Comments
 (0)