Skip to content

Commit 218aafa

Browse files
committed
TST: expand dualTR parrec test to check warning
1 parent 95f93fb commit 218aafa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nibabel/tests/test_parrec.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,13 @@ def test_exts2par():
782782

783783

784784
def test_dualTR():
785+
expected_TRs = np.asarray([2000., 500.])
785786
with open(DUAL_TR_PAR, 'rt') as fobj:
786-
with suppress_warnings():
787+
with clear_and_catch_warnings(modules=[parrec], record=True) as wlist:
788+
simplefilter('always')
787789
dualTR_hdr = PARRECHeader.from_fileobj(fobj)
790+
assert_equal(len(wlist), 1)
788791
assert_array_equal(dualTR_hdr.general_info['repetition_time'],
789-
np.asarray([2000., 500.]))
792+
expected_TRs)
793+
# zoom on 4th dimensions is the first TR (in seconds)
794+
assert_equal(dualTR_hdr.get_zooms()[3], expected_TRs[0]/1000)

0 commit comments

Comments
 (0)