Skip to content

Commit d0d40f4

Browse files
committed
test: Improve skdecimal test
1 parent ce7d813 commit d0d40f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/optimize/test_hyperopt.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,14 @@ def test_SKDecimal():
11941194
assert not space._contains(1.511)
11951195
assert not space._contains(1.111222)
11961196

1197+
with pytest.raises(ValueError):
1198+
SKDecimal(1, 2, step=5, decimals=0.2)
1199+
1200+
s = SKDecimal(1, 2, step=0.1, decimals=None)
1201+
assert s.step == 0.1
1202+
assert s._contains(1.1)
1203+
assert not s._contains(1.11)
1204+
11971205

11981206
def test_stake_amount_unlimited_max_open_trades(mocker, hyperopt_conf, tmp_path, fee) -> None:
11991207
# This test is to ensure that unlimited max_open_trades are ignored for the backtesting

0 commit comments

Comments
 (0)