Skip to content

Commit 8f62082

Browse files
committed
fixed up doctest and started to add pytest framework
1 parent 30f29a0 commit 8f62082

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
import pytest
3+
4+
# For debugging in IDE's don't catch raised exceptions and let the IDE
5+
# break at it
6+
if os.getenv("_PYTEST_RAISE", "0") != "0":
7+
8+
@pytest.hookimpl(tryfirst=True)
9+
def pytest_exception_interact(call):
10+
raise call.excinfo.value
11+
12+
@pytest.hookimpl(tryfirst=True)
13+
def pytest_internalerror(excinfo):
14+
raise excinfo.value

pydra/tasks/dcm2niix/tests/test_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ def test_dcm2niix():
77
task.inputs.out_dir = "test-data"
88
task.inputs.compress = "y"
99
assert (
10-
task.cmdline
11-
== "dcm2niix -o 'test-data' -f 'out_file' -z y 'test-data/test_dicoms'"
10+
task.cmdline == "dcm2niix -o test-data -f out_file -z y test-data/test_dicoms"
1211
)

pydra/tasks/dcm2niix/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class Dcm2Niix(ShellCommandTask):
362362
>>> task.inputs.out_dir = "test-data"
363363
>>> task.inputs.compress = "y"
364364
>>> task.cmdline
365-
"dcm2niix -o 'test-data' -f 'out_file' -z y 'test-data/test_dicoms'"
365+
"dcm2niix -o test-data -f out_file -z y test-data/test_dicoms"
366366
"""
367367

368368
input_spec = Dcm2NiixInputSpec

0 commit comments

Comments
 (0)