Skip to content

Commit fb2f815

Browse files
committed
naive test
1 parent e33c8f2 commit fb2f815

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

aeon/forecasting/tests/test_naive.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ def test_predict():
6969
"""Test different input for private predict."""
7070
forecaster = NaiveForecaster(strategy="mean")
7171
y = np.array([1, 2, 3, 4, 5, 6, 7, 8])
72-
x = forecaster._predict(y)
73-
assert isinstance(x, float)
72+
pred = forecaster._predict(y)
73+
np.testing.assert_allclose(pred, 4.5)
74+
assert isinstance(pred, float)
7475
forecaster = NaiveForecaster(strategy="seasonal_last", seasonal_period=2)
7576
forecaster._fit(y)
7677
assert forecaster.forecast_ == 7.0
7778
forecaster = NaiveForecaster(strategy="FOOBAR")
7879
with pytest.raises(ValueError, match="Unknown strategy"):
79-
x = forecaster._fit(y)
80+
forecaster._fit(y)
8081
with pytest.raises(ValueError, match="Unknown strategy"):
81-
x = forecaster._predict(y)
82+
forecaster._predict(y)

0 commit comments

Comments
 (0)