Skip to content

Commit fd90c09

Browse files
committed
Experimenting. I expect a linting isue.
1 parent 06be149 commit fd90c09

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

tests/anoph/test_frq_2.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
import plotly.graph_objects as go # type: ignore
3+
4+
5+
@pytest.mark.skip
6+
def test_plot_frequencies_heatmap(api, frq_df):
7+
fig = api.plot_frequencies_heatmap(frq_df, show=False, max_len=None)
8+
assert isinstance(fig, go.Figure)
9+
10+
# Test max_len behaviour.
11+
with pytest.raises(ValueError):
12+
api.plot_frequencies_heatmap(frq_df, show=False, max_len=len(frq_df) - 1)
13+
14+
# Test index parameter - if None, should use dataframe index.
15+
fig = api.plot_frequencies_heatmap(frq_df, show=False, index=None, max_len=None)
16+
# Not unique.
17+
with pytest.raises(ValueError):
18+
api.plot_frequencies_heatmap(frq_df, show=False, index="contig", max_len=None)

tests/anoph/test_snp_frq.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from malariagen_data import ag3 as _ag3
1313
from malariagen_data.anoph.snp_frq import AnophelesSnpFrequencyAnalysis
1414
from malariagen_data.util import compare_series_like
15+
from .test_frq_2 import test_plot_frequencies_heatmap
1516

1617

1718
@pytest.fixture
@@ -314,6 +315,8 @@ def test_allele_frequencies_with_str_cohorts(
314315
# Run the function under test.
315316
df_snp = api.snp_allele_frequencies(**params)
316317

318+
test_plot_frequencies_heatmap(api, df_snp)
319+
317320
# Figure out expected cohort labels.
318321
df_samples = api.sample_metadata(sample_sets=sample_sets)
319322
if "cohort_" + cohorts in df_samples:
@@ -334,6 +337,8 @@ def test_allele_frequencies_with_str_cohorts(
334337
# Run the function under test.
335338
df_aa = api.aa_allele_frequencies(**params)
336339

340+
test_plot_frequencies_heatmap(api, df_aa)
341+
337342
# Standard checks.
338343
check_aa_allele_frequencies(
339344
df=df_aa,

0 commit comments

Comments
 (0)