Make BaseParameter get_space abstract

This commit is contained in:
Matthias
2021-03-28 19:31:54 +02:00
parent 8022386404
commit 20f7e9b4b7
2 changed files with 8 additions and 5 deletions

View File

@@ -571,9 +571,8 @@ def test_hyperopt_parameters():
with pytest.raises(OperationalException, match=r"FloatParameter space invalid\."):
FloatParameter([0, 10], high=7, default=5, space='buy')
x = BaseParameter(opt_range=[0, 1], default=1, space='buy')
with pytest.raises(NotImplementedError):
x.get_space('space')
with pytest.raises(TypeError):
BaseParameter(opt_range=[0, 1], default=1, space='buy')
fltpar = IntParameter(low=0, high=5, default=1, space='buy')
assert fltpar.value == 1