We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e78aa4b commit cfda42eCopy full SHA for cfda42e
nibabies/interfaces/conftest.py
@@ -0,0 +1,30 @@
1
+"""py.test configuration"""
2
+from pathlib import Path
3
+import pytest
4
+from tempfile import TemporaryDirectory
5
+
6
7
+FILES = (
8
+ 'functional.nii',
9
+ 'anatomical.nii',
10
+ 'epi.nii',
11
+ 'T1w.nii',
12
+ 'func_to_struct.mat',
13
+ 'sub-01_run-01_echo-1_bold.nii.gz',
14
+ 'sub-01_run-01_echo-2_bold.nii.gz',
15
+ 'sub-01_run-01_echo-3_bold.nii.gz',
16
+)
17
18
19
+@pytest.fixture(scope="package")
20
+def data_dir():
21
+ with TemporaryDirectory() as tmpdir:
22
+ tmp_path = Path(tmpdir)
23
+ for fname in FILES:
24
+ Path.touch(tmp_path / fname)
25
+ yield tmp_path
26
27
28
+@pytest.fixture(autouse=True)
29
+def set_namespace(doctest_namespace, data_dir):
30
+ doctest_namespace["data_dir"] = data_dir
0 commit comments