def test_analogsignal_shortening_warning(self):
nio = NeuralynxIO(self.sn, use_cache='never')
with reset_warning_registry():
with warnings.catch_warnings(record=True) as w:
seg = Segment('testsegment')
nio.read_ncs(os.path.join(self.sn, 'Tet3a.ncs'), seg)
self.assertGreater(len(w), 0)
self.assertTrue(issubclass(w[0].category, UserWarning))
self.assertTrue('Analogsignalarray was shortened due to gap in'
' recorded data of file'
in str(w[0].message))
# This class is copied from
# 'http://bugs.python.org/file40031/reset_warning_registry.py' by Eli Collins
# and is related to http://bugs.python.org/issue21724 Python<3.4
评论列表
文章目录