Author: Edd Barrett <[email protected]>
Branch: improve-errors-again2
Changeset: r66666:ac649649ad04
Date: 2013-08-30 14:56 +0100
http://bitbucket.org/pypy/pypy/changeset/ac649649ad04/
Log: (Edd, Ronan) Check for more specific exceptions.
diff --git a/rpython/rlib/test/test_signature.py
b/rpython/rlib/test/test_signature.py
--- a/rpython/rlib/test/test_signature.py
+++ b/rpython/rlib/test/test_signature.py
@@ -2,6 +2,7 @@
from rpython.rlib.signature import signature, finishsigs, FieldSpec, ClassSpec
from rpython.rlib import types
from rpython.annotator import model
+from rpython.annotator.signature import SignatureError
from rpython.translator.translator import TranslationContext, graphof
from rpython.rtyper.lltypesystem import rstr
from rpython.rtyper.annlowlevel import LowLevelAnnotatorPolicy
@@ -24,7 +25,7 @@
return sigof(a, f)
def check_annotator_fails(caller):
- exc = py.test.raises(Exception, annotate_at, caller).value
+ exc = py.test.raises(model.AnnotatorError, annotate_at, caller).value
assert caller.func_name in str(exc)
@@ -245,7 +246,7 @@
def incomplete_sig_meth(self):
pass
- exc = py.test.raises(Exception, annotate_at, C.incomplete_sig_meth).value
+ exc = py.test.raises(SignatureError, annotate_at,
C.incomplete_sig_meth).value
assert 'incomplete_sig_meth' in str(exc)
assert 'finishsigs' in str(exc)
@@ -268,7 +269,7 @@
@signature(types.str(), returns=types.int())
def cannot_add_string(x):
return f(x, 2)
- exc = py.test.raises(Exception, annotate_at, cannot_add_string).value
+ exc = py.test.raises(model.AnnotatorError, annotate_at,
cannot_add_string).value
assert 'Blocked block' in str(exc)
def test_return_any():
@@ -281,7 +282,7 @@
@signature(types.str(), returns=types.any())
def cannot_add_string(x):
return f(3) + x
- exc = py.test.raises(Exception, annotate_at, cannot_add_string).value
+ exc = py.test.raises(model.AnnotatorError, annotate_at,
cannot_add_string).value
assert 'Blocked block' in str(exc)
assert 'cannot_add_string' in str(exc)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit