Commits

Philip Jenvey committed 61217b6

cleanup

Comments (0)

Files changed (1)

pypy/objspace/std/test/test_lengthhint.py

-from pypy.interpreter.error import OperationError
 from pypy.module._collections.interp_deque import W_Deque
 from pypy.module.itertools.interp_itertools import W_Repeat
 
                     return -1
             return Foo()
         """)
-        try:
-            space.length_hint(w_foo, 3)
-        except OperationError, e:
-            assert e.match(space, space.w_ValueError)
-        else:
-            assert False, 'ValueError expected'
+        space.raises_w(space.w_ValueError, space.length_hint, w_foo, 3)
 
     def test_exc(self):
         space = self.space
                     1 / 0
             return Foo()
         """)
-        try:
-            space.length_hint(w_foo, 3)
-        except OperationError, e:
-            assert e.match(space, space.w_ZeroDivisionError)
-        else:
-            assert False, 'ZeroDivisionError expected'
+        space.raises_w(space.w_ZeroDivisionError, space.length_hint, w_foo, 3)