Skip to content

Commit 0512c22

Browse files
committed
fix leaky modification
1 parent 5a38615 commit 0512c22

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

nimare/tests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Generate fixtures for tests."""
22

3+
import copy
34
import json
45
import os
56
from 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")
204211
def example_nimads_annotation():
205212
"""Download/lookup example NiMADS annotation."""

0 commit comments

Comments
 (0)