Author: Matti Picus <[email protected]>
Branch: str-dtype-improvement
Changeset: r62557:ab13ea6f9492
Date: 2013-03-20 11:57 -0700
http://bitbucket.org/pypy/pypy/changeset/ab13ea6f9492/

Log:    check result from raises in tests

diff --git a/pypy/module/micronumpy/test/test_numarray.py 
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -1494,13 +1494,16 @@
         a = concatenate((zeros((2,),dtype=[('x', int), ('y', float)]),
                          zeros((2,),dtype=[('x', int), ('y', float)])))
         assert a.shape == (4,)
-        raises(TypeError, concatenate, 
+        exc = raises(TypeError, concatenate, 
                             (zeros((2,), dtype=[('x', int), ('y', float)]),
                             (zeros((2,), dtype=[('x', float), ('y', float)]))))
-        raises(TypeError, concatenate, ([1], zeros((2,),
+        assert str(exc.value).startswith('record type mismatch')
+        exc = raises(TypeError, concatenate, ([1], zeros((2,),
                                             dtype=[('x', int), ('y', float)])))
-        raises(TypeError, concatenate, (['abc'], zeros((2,),
+        assert str(exc.value).startswith('invalid type promotion')
+        exc = raises(TypeError, concatenate, (['abc'], zeros((2,),
                                             dtype=[('x', int), ('y', float)])))
+        assert str(exc.value).startswith('invalid type promotion')
 
 
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to