Skip to content

Commit f0133a2

Browse files
committed
Simplify dicom check, add more comments for test_monitor
1 parent 0cb8fab commit f0133a2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

heudiconv/convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def convert(items, converter, scaninfo_suffix, custom_callable, with_prov,
236236

237237
prefix, outtypes, item_dicoms = item[:3]
238238
if not isinstance(outtypes, (list, tuple)):
239-
outtypes = [outtypes]
239+
outtypes = (outtypes,)
240240

241241
prefix_dirname = op.dirname(prefix + '.ext')
242242
outname_bids = prefix + '.json'
@@ -246,7 +246,7 @@ def convert(items, converter, scaninfo_suffix, custom_callable, with_prov,
246246
prefix, len(item_dicoms), prefix_dirname, converter, outtypes)
247247
# We want to create this dir only if we are converting it to nifti,
248248
# or if we're using BIDS
249-
dicom_only = len(outtypes) == 1 and outtypes[0] == 'dicom'
249+
dicom_only = outtypes == ('dicom',)
250250
if not(dicom_only and bids) and not op.exists(prefix_dirname):
251251
os.makedirs(prefix_dirname)
252252

tests/test_heuristics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def test_ls(stdout):
127127

128128

129129
def test_scout_conversion(tmpdir):
130+
tmppath = tmpdir.strpath
130131
args = (
131-
"-b -f reproin --files %s -o %s"
132-
% (TESTS_DATA_PATH, tmpdir)
133-
).split(' ')
132+
"-b -f reproin --files %s"
133+
% (TESTS_DATA_PATH)
134+
).split(' ') + ['-o', tmppath]
134135
runner(args)
135-
tmppath = tmpdir.strpath
136136

137137
assert not op.exists(pjoin(
138138
tmppath,

tests/test_monitor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
my_events = [(header, type_names, watch_path, filename),
2222
(header, type_names, path2, b'')]
2323
except AttributeError:
24+
# Import of inotify fails on mac os x with error
25+
# lsym(0x11fbeb780, inotify_init): symbol not found
26+
# because inotify doesn't seem to exist on Mac OS X
2427
my_events = []
25-
pytestmark = pytest.mark.skip(reason='TODO')
28+
pytestmark = pytest.mark.skip(reason='Unable to import inotify')
2629

2730

2831
class MockInotifyTree(object):

0 commit comments

Comments
 (0)