提交 a0344d4b authored 作者: Frederic's avatar Frederic

Remove not used var tval, simplify the test and test for the error!

上级 c89e6975
......@@ -2918,11 +2918,8 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
oldlevel = _logger.level
_logger.setLevel(logging.CRITICAL)
try:
try:
tval = self.eval_output_and_check([t])
assert 0
except IndexError, e:
pass
self.assertRaises(IndexError,
self.eval_output_and_check, [t])
finally:
_logger.setLevel(oldlevel)
finally:
......@@ -2930,16 +2927,13 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
def test2_err_bounds1(self):
n = self.shared((numpy.ones((2, 3), dtype=self.dtype) * 5))
t = n[4:5, 2]
t = n[4:5, 3]
self.assertTrue(isinstance(t.owner.op, Subtensor))
old_stderr = sys.stderr
sys.stderr = StringIO.StringIO()
try:
try:
tval = self.eval_output_and_check([t])
except Exception, e:
if e[0] != 'index out of bounds':
raise
self.assertRaises(IndexError,
self.eval_output_and_check, [t])
finally:
sys.stderr = old_stderr
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论