Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii Fuglaev committed Sep 4, 2024
1 parent fee27c3 commit 000690e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tests/test_commands/test_backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def test_backtest_with_numeric_segments(
base_timeseries_numeric_segments_path,
):
target = pd.read_csv(base_timeseries_numeric_segments_path, dtype={"segment": str})
segments = target.segments.unique()
segments = target["segment"].unique()

tmp_output = TemporaryDirectory()
tmp_output_path = Path(tmp_output.name)
Expand All @@ -204,8 +204,8 @@ def test_backtest_with_numeric_segments(
]
)
df_forecast = pd.read_csv(tmp_output_path / "forecast.csv", dtype={"segment": str})
output_segments = df_forecast.segment.unique()
assert segments == output_segments
output_segments = df_forecast["segment"].unique()
assert set(segments) == set(output_segments)


def test_backtest_with_numeric_segments_with_exog(
Expand All @@ -215,7 +215,7 @@ def test_backtest_with_numeric_segments_with_exog(
base_timeseries_numeric_segments_exog_path,
):
target = pd.read_csv(base_timeseries_numeric_segments_path, dtype={"segment": str})
segments = target.segments.unique()
segments = target["segment"].unique()

tmp_output = TemporaryDirectory()
tmp_output_path = Path(tmp_output.name)
Expand All @@ -232,5 +232,5 @@ def test_backtest_with_numeric_segments_with_exog(
]
)
df_forecast = pd.read_csv(tmp_output_path / "forecast.csv", dtype={"segment": str})
output_segments = df_forecast.segment.unique()
assert segments == output_segments
output_segments = df_forecast["segment"].unique()
assert set(segments) == set(output_segments)
12 changes: 6 additions & 6 deletions tests/test_commands/test_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def test_forecast_with_numeric_segments(
base_timeseries_numeric_segments_path,
):
target = pd.read_csv(base_timeseries_numeric_segments_path, dtype={"segment": str})
segments = target.segments.unique()
segments = target["segment"].unique()

tmp_output = NamedTemporaryFile("w")
tmp_output_path = Path(tmp_output.name)
Expand All @@ -431,8 +431,8 @@ def test_forecast_with_numeric_segments(
],
)
df_output = pd.read_csv(tmp_output_path, dtype={"segment": str})
output_segments = df_output.segment.unique()
assert segments == output_segments
output_segments = df_output["segment"].unique()
assert set(segments) == set(output_segments)


@pytest.mark.parametrize(
Expand All @@ -446,7 +446,7 @@ def test_forecast_with_numeric_segments_with_exog(
request,
):
target = pd.read_csv(base_timeseries_numeric_segments_path, dtype={"segment": str})
segments = target.segments.unique()
segments = target["segment"].unique()

tmp_output = NamedTemporaryFile("w")
tmp_output_path = Path(tmp_output.name)
Expand All @@ -463,5 +463,5 @@ def test_forecast_with_numeric_segments_with_exog(
],
)
df_output = pd.read_csv(tmp_output_path, dtype={"segment": str})
output_segments = df_output.segment.unique()
assert segments == output_segments
output_segments = df_output["segment"].unique()
assert set(segments) == set(output_segments)

0 comments on commit 000690e

Please sign in to comment.