Skip to content

Commit 504a73d

Browse files
Fix test_frq.py to handle single-row dataframes in CI environment
1 parent 3feb26e commit 504a73d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/anoph/test_frq.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ def check_plot_frequencies_heatmap(api, frq_df):
1010
assert isinstance(fig, go.Figure)
1111

1212
# Test max_len behaviour.
13+
# Only test if we have more than 1 row, otherwise set max_len to 0
14+
# should still raise ValueError
15+
if len(frq_df) > 1:
16+
test_max_len = len(frq_df) - 1
17+
else:
18+
test_max_len = 0
19+
1320
with pytest.raises(ValueError):
14-
api.plot_frequencies_heatmap(frq_df, show=False, max_len=len(frq_df) - 1)
21+
api.plot_frequencies_heatmap(frq_df, show=False, max_len=test_max_len)
1522

1623
# Test index parameter - if None, should use dataframe index.
1724
fig = api.plot_frequencies_heatmap(frq_df, show=False, index=None, max_len=None)

0 commit comments

Comments
 (0)