Skip to content

Commit 5d04900

Browse files
committed
test: skip test_hap_frequencies_with_str_cohorts when random region has no SNPs
The test uses fixture.random_region_str() which can occasionally pick a region with no SNPs, causing ValueError. Added the same try/except guard already used in test_hap_frequencies_advanced.
1 parent c497ed2 commit 5d04900

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/anoph/test_hap_frq.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ def test_hap_frequencies_with_str_cohorts(
187187
return
188188

189189
# Run the function under test.
190-
df_hap = api.haplotypes_frequencies(**params)
190+
try:
191+
df_hap = api.haplotypes_frequencies(**params)
192+
except ValueError as e:
193+
if "No SNPs available for the given region" in str(e):
194+
pytest.skip("Random region contained no SNPs")
195+
raise
191196

192197
check_plot_frequencies_heatmap(api, df_hap)
193198

0 commit comments

Comments
 (0)