Skip to content

Commit 17ad16c

Browse files
committed
TEST: Add smoke test for parse_args to exercise BIDSLayout creation
1 parent 465427c commit 17ad16c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

fmriprep/cli/tests/test_parser.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
#
2323
"""Test parser."""
2424
from packaging.version import Version
25+
from pkg_resources import resource_filename as pkgrf
2526
import pytest
26-
from ..parser import _build_parser
27+
from ..parser import _build_parser, parse_args
2728
from .. import version as _version
2829
from ... import config
30+
from ...tests.test_config import _reset_config
2931

3032
MIN_ARGS = ["data/", "out/", "participant"]
3133

@@ -136,3 +138,13 @@ def _mock_is_bl(*args, **kwargs):
136138
assert ("FLAGGED" in captured) is flagged[0]
137139
if flagged[0]:
138140
assert (flagged[1] or "reason: unknown") in captured
141+
142+
143+
def test_parse_args(tmp_path):
144+
"""Basic smoke test showing that our parse_args() function
145+
implements the BIDS App protocol"""
146+
bids_dir = pkgrf('fmriprep', 'data/tests/ds000005')
147+
148+
parse_args(args=[bids_dir, str(tmp_path), "participant"])
149+
assert config.execution.layout.root == bids_dir
150+
_reset_config()

0 commit comments

Comments
 (0)