Skip to content

Commit 683aa1b

Browse files
Replace local Ag3/Af1 definitions with setup_ag3/setup_af1
1 parent 5099583 commit 683aa1b

File tree

2 files changed

+16
-26
lines changed

2 files changed

+16
-26
lines changed

tests/integration/test_af1.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,8 @@ def test_karyotyping(inversion):
9292
)
9393

9494

95-
@pytest.fixture(scope="module")
96-
def af1():
97-
return Af1(
98-
"simplecache::gs://vo_afun_release_master_us_central1/",
99-
simplecache=dict(cache_storage="gcs_cache"),
100-
debug=True,
101-
)
102-
103-
104-
def test_plot_haplotype_network_string_direct(af1, mocker):
95+
def test_plot_haplotype_network_string_direct(mocker):
96+
af1 = setup_af1(debug=True)
10597
mocker.patch("dash.Dash.run")
10698
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
10799
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])
@@ -122,7 +114,8 @@ def test_plot_haplotype_network_string_direct(af1, mocker):
122114
assert call_args["ht_color_counts"] is not None
123115

124116

125-
def test_plot_haplotype_network_string_cohort(af1, mocker):
117+
def test_plot_haplotype_network_string_cohort(mocker):
118+
af1 = setup_af1(debug=True)
126119
mocker.patch("dash.Dash.run")
127120
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
128121
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])
@@ -143,7 +136,8 @@ def test_plot_haplotype_network_string_cohort(af1, mocker):
143136
assert call_args["ht_color_counts"] is not None
144137

145138

146-
def test_plot_haplotype_network_mapping(af1, mocker):
139+
def test_plot_haplotype_network_mapping(mocker):
140+
af1 = setup_af1(debug=True)
147141
mocker.patch("dash.Dash.run")
148142
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
149143
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])
@@ -165,7 +159,8 @@ def test_plot_haplotype_network_mapping(af1, mocker):
165159
assert call_args["ht_color_counts"] is not None
166160

167161

168-
def test_plot_haplotype_network_none(af1, mocker):
162+
def test_plot_haplotype_network_none(mocker):
163+
af1 = setup_af1(debug=True)
169164
mocker.patch("dash.Dash.run")
170165
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
171166
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])

tests/integration/test_ag3.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,8 @@ def test_karyotyping(inversion):
188188
assert all(df[f"karyotype_{inversion}_mean"].between(0, 2))
189189

190190

191-
@pytest.fixture(scope="module")
192-
def ag3():
193-
return Ag3(
194-
"simplecache::gs://vo_agam_release_master_us_central1",
195-
simplecache=dict(cache_storage="gcs_cache"),
196-
debug=True,
197-
)
198-
199-
200-
def test_plot_haplotype_network_string_direct(ag3, mocker):
191+
def test_plot_haplotype_network_string_direct(mocker):
192+
ag3 = setup_ag3()
201193
mocker.patch("dash.Dash.run")
202194
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
203195
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])
@@ -218,7 +210,8 @@ def test_plot_haplotype_network_string_direct(ag3, mocker):
218210
assert call_args["ht_color_counts"] is not None
219211

220212

221-
def test_plot_haplotype_network_string_cohort(ag3, mocker):
213+
def test_plot_haplotype_network_string_cohort(mocker):
214+
ag3 = setup_ag3()
222215
mocker.patch("dash.Dash.run")
223216
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
224217
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])
@@ -239,7 +232,8 @@ def test_plot_haplotype_network_string_cohort(ag3, mocker):
239232
assert call_args["ht_color_counts"] is not None
240233

241234

242-
def test_plot_haplotype_network_mapping(ag3, mocker):
235+
def test_plot_haplotype_network_mapping(mocker):
236+
ag3 = setup_ag3()
243237
mocker.patch("dash.Dash.run")
244238
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
245239
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])
@@ -261,7 +255,8 @@ def test_plot_haplotype_network_mapping(ag3, mocker):
261255
assert call_args["ht_color_counts"] is not None
262256

263257

264-
def test_plot_haplotype_network_none(ag3, mocker):
258+
def test_plot_haplotype_network_none(mocker):
259+
ag3 = setup_ag3()
265260
mocker.patch("dash.Dash.run")
266261
mock_mjn = mocker.patch("malariagen_data.anopheles.mjn_graph")
267262
mock_mjn.return_value = ([{"data": {"id": "n1"}}], [])

0 commit comments

Comments
 (0)