[pypy-commit] pypy length-hint: cleanup
pjenvey
noreply at buildbot.pypy.org
Mon Oct 8 00:31:37 CEST 2012
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: length-hint
Changeset: r57873:61217b655c79
Date: 2012-10-07 15:24 -0700
http://bitbucket.org/pypy/pypy/changeset/61217b655c79/
Log: cleanup
diff --git a/pypy/objspace/std/test/test_lengthhint.py b/pypy/objspace/std/test/test_lengthhint.py
--- a/pypy/objspace/std/test/test_lengthhint.py
+++ b/pypy/objspace/std/test/test_lengthhint.py
@@ -1,4 +1,3 @@
-from pypy.interpreter.error import OperationError
from pypy.module._collections.interp_deque import W_Deque
from pypy.module.itertools.interp_itertools import W_Repeat
@@ -131,12 +130,7 @@
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
@@ -146,9 +140,4 @@
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)
More information about the pypy-commit
mailing list