File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Generate fixtures for tests."""
22
3+ import copy
34import json
45import os
56from shutil import copyfile
@@ -187,7 +188,7 @@ def sample_size_nimads_studyset():
187188
188189
189190@pytest .fixture (scope = "session" )
190- def example_nimads_studyset ():
191+ def _example_nimads_studyset_data ():
191192 """Download/lookup example NiMADS studyset."""
192193 out_file = os .path .join (get_test_data_path (), "nimads_studyset.json" )
193194 if not os .path .isfile (out_file ):
@@ -200,6 +201,12 @@ def example_nimads_studyset():
200201 return studyset
201202
202203
204+ @pytest .fixture (scope = "function" )
205+ def example_nimads_studyset (_example_nimads_studyset_data ):
206+ """Provide an isolated copy of the example NiMADS studyset per test."""
207+ return copy .deepcopy (_example_nimads_studyset_data )
208+
209+
203210@pytest .fixture (scope = "session" )
204211def example_nimads_annotation ():
205212 """Download/lookup example NiMADS annotation."""
You can’t perform that action at this time.
0 commit comments