Skip to content
22 changes: 18 additions & 4 deletions tests/anoph/test_snp_frq.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,11 @@ def test_allele_frequencies_with_str_cohorts_and_sample_query(
)

# Run the function under test.
df_snp = api.snp_allele_frequencies(**params)
# N.B., may raise ValueError if random params yield no variant SNPs.
try:
df_snp = api.snp_allele_frequencies(**params)
except ValueError:
return

check_plot_frequencies_heatmap(api, df_snp)

Expand All @@ -529,7 +533,10 @@ def test_allele_frequencies_with_str_cohorts_and_sample_query(
)

# Run the function under test.
df_aa = api.aa_allele_frequencies(**params)
try:
df_aa = api.aa_allele_frequencies(**params)
except ValueError:
return

check_plot_frequencies_heatmap(api, df_aa)

Expand Down Expand Up @@ -589,7 +596,11 @@ def test_allele_frequencies_with_str_cohorts_and_sample_query_options(
)

# Run the function under test.
df_snp = api.snp_allele_frequencies(**params)
# N.B., may raise ValueError if random params yield no variant SNPs.
try:
df_snp = api.snp_allele_frequencies(**params)
except ValueError:
return

check_plot_frequencies_heatmap(api, df_snp)

Expand All @@ -602,7 +613,10 @@ def test_allele_frequencies_with_str_cohorts_and_sample_query_options(
)

# Run the function under test.
df_aa = api.aa_allele_frequencies(**params)
try:
df_aa = api.aa_allele_frequencies(**params)
except ValueError:
return

check_plot_frequencies_heatmap(api, df_aa)

Expand Down
Loading