[pypy-commit] pypy str-dtype-improvement: check result from raises in tests
mattip
noreply at buildbot.pypy.org
Wed Mar 20 21:16:21 CET 2013
Author: Matti Picus <matti.picus at gmail.com>
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')
More information about the pypy-commit
mailing list