1616from ..ecat import EcatHeader , EcatMlist , EcatSubHeader , EcatImage
1717
1818from unittest import TestCase
19- import warnings
2019from nose .tools import (assert_true , assert_false , assert_equal ,
2120 assert_not_equal , assert_raises )
2221
2322from numpy .testing import assert_array_equal , assert_array_almost_equal
2423
25- from ..testing import data_path
24+ from ..testing import data_path , suppress_warnings
2625from ..tmpdirs import InTemporaryDirectory
2726
2827from .test_wrapstruct import _TestWrapStructBase
@@ -112,7 +111,7 @@ def test_mlist(self):
112111 6.01670000e+04 , 1.00000000e+00 ],
113112 [ 1.68427580e+07 , 6.01680000e+04 ,
114113 7.22000000e+04 , 1.00000000e+00 ]])
115- with warnings . catch_warnings ( record = True ): # STORED order
114+ with suppress_warnings ( ): # STORED order
116115 assert_true (badordermlist .get_frame_order ()[0 ][0 ] == 1 )
117116
118117 def test_mlist_errors (self ):
@@ -132,19 +131,19 @@ def test_mlist_errors(self):
132131 6.01670000e+04 , 1.00000000e+00 ],
133132 [ 1.68427580e+07 , 6.01680000e+04 ,
134133 7.22000000e+04 , 1.00000000e+00 ]])
135- with warnings . catch_warnings ( record = True ): # STORED order
134+ with suppress_warnings ( ): # STORED order
136135 series_framenumbers = mlist .get_series_framenumbers ()
137136 # first frame stored was actually 2nd frame acquired
138137 assert_true (series_framenumbers [0 ] == 2 )
139138 order = [series_framenumbers [x ] for x in sorted (series_framenumbers )]
140139 # true series order is [2,1,3,4,5,6], note counting starts at 1
141140 assert_true (order == [2 , 1 , 3 , 4 , 5 , 6 ])
142141 mlist ._mlist [0 ,0 ] = 0
143- with warnings . catch_warnings ( record = True ):
142+ with suppress_warnings ( ):
144143 frames_order = mlist .get_frame_order ()
145144 neworder = [frames_order [x ][0 ] for x in sorted (frames_order )]
146145 assert_true (neworder == [1 , 2 , 3 , 4 , 5 ])
147- with warnings . catch_warnings ( record = True ):
146+ with suppress_warnings ( ):
148147 assert_raises (IOError ,
149148 mlist .get_series_framenumbers )
150149
0 commit comments