Skip to content

Commit 4ffa4c1

Browse files
committed
Extend test_hap_frequencies_advanced() to include period_by as random_year
1 parent 27e4b72 commit 4ffa4c1

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
@@ -15,6 +15,7 @@
1515
check_plot_frequencies_time_series_with_taxa,
1616
check_plot_frequencies_time_series_with_areas,
1717
check_plot_frequencies_interactive_map,
18+
add_random_year,
1819
)
1920

2021

@@ -200,7 +201,7 @@ def test_hap_frequencies_with_str_cohorts(
200201

201202
@pytest.mark.parametrize(
202203
"area_by, period_by",
203-
[("admin1_iso", "year"), ("admin2_name", "year")],
204+
[("admin1_iso", "year"), ("admin2_name", "year"), ("admin1_iso", "random_year")],
204205
)
205206
@parametrize_with_cases("fixture,api", cases=".")
206207
def test_hap_frequencies_advanced(
@@ -211,6 +212,10 @@ def test_hap_frequencies_advanced(
211212
min_cohort_size = random.randint(0, 2)
212213
region = fixture.random_region_str()
213214

215+
if period_by == "random_year":
216+
# Add a random_year column to the sample metadata, if there isn't already.
217+
api = add_random_year(api=api)
218+
214219
# Set up call params.
215220
params_advanced = dict(
216221
region=region,

0 commit comments

Comments
 (0)