Skip to content

Commit 2067982

Browse files
committed
ENH: ls test -- take Matthew's snippet with better msg
1 parent 6309513 commit 2067982

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

nibabel/tests/test_scripts.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ def test_nib_ls_multiple():
9898

9999
# they should be indented correctly. Since all files are int type -
100100
ln = max(len(f) for f in fnames)
101-
little_endian = sys.byteorder == 'little'
102-
assert_equal([l[ln:ln+2+int(not little_endian)] for l in stdout_lines],
103-
[' i']*4 if little_endian else [' <i']*4,
104-
msg="Type sub-string didn't start with 'i'. "
105-
"Full output was: %s" % stdout_lines)
101+
i_str = ' i' if sys.byteorder == 'little' else ' <i'
102+
assert_equal([l[ln:ln + len(i_str)] for l in stdout_lines], [i_str] * 4,
103+
msg="Type sub-string didn't start with '%s'. "
104+
"Full output was: %s" % (i_str, stdout_lines))
106105
# and if disregard type indicator which might vary
107106
assert_equal(
108107
[l[l.index('['):] for l in stdout_lines],

0 commit comments

Comments
 (0)