File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -378,11 +378,6 @@ def test_allele_frequencies_with_str_cohorts(
378378 api .snp_allele_frequencies (** params )
379379 return
380380
381- # Run the function under test.
382- df_snp = api .snp_allele_frequencies (** params )
383-
384- check_plot_frequencies_heatmap (api , df_snp )
385-
386381 # Figure out expected cohort labels.
387382 df_samples = api .sample_metadata (sample_sets = sample_sets )
388383 if "cohort_" + cohorts in df_samples :
@@ -392,6 +387,18 @@ def test_allele_frequencies_with_str_cohorts(
392387 cohort_counts = df_samples [cohort_column ].value_counts ()
393388 cohort_labels = cohort_counts [cohort_counts >= min_cohort_size ].index .to_list ()
394389
390+ if len (cohort_labels ) == 0 :
391+ with pytest .raises (ValueError ):
392+ api .snp_allele_frequencies (** params )
393+ with pytest .raises (ValueError ):
394+ api .aa_allele_frequencies (** params )
395+ return
396+
397+ # Run the function under test.
398+ df_snp = api .snp_allele_frequencies (** params )
399+
400+ check_plot_frequencies_heatmap (api , df_snp )
401+
395402 # Standard checks.
396403 check_snp_allele_frequencies (
397404 api = api ,
You can’t perform that action at this time.
0 commit comments