Author: Alex Gaynor <[email protected]>
Branch: numpy-exp
Changeset: r44219:d9b2a5e9bdb9
Date: 2011-05-16 15:59 -0500
http://bitbucket.org/pypy/pypy/changeset/d9b2a5e9bdb9/
Log: Added some unittests for signatures.
diff --git a/pypy/module/micronumpy/test/test_base.py
b/pypy/module/micronumpy/test/test_base.py
--- a/pypy/module/micronumpy/test/test_base.py
+++ b/pypy/module/micronumpy/test/test_base.py
@@ -1,6 +1,24 @@
from pypy.conftest import gettestobjspace
+from pypy.module.micronumpy.interp_numarray import SingleDimArray, FloatWrapper
class BaseNumpyAppTest(object):
def setup_class(cls):
- cls.space = gettestobjspace(usemodules=('micronumpy',))
\ No newline at end of file
+ cls.space = gettestobjspace(usemodules=('micronumpy',))
+
+
+class TestSignature(object):
+ def setup_class(cls):
+ cls.space = gettestobjspace()
+
+ def test_binop_signature(self):
+ space = self.space
+
+ ar = SingleDimArray(10)
+ v1 = ar.descr_add(space, ar)
+ v2 = ar.descr_add(space, FloatWrapper(2.0))
+ assert v1.signature is not v2.signature
+ v3 = ar.descr_add(space, FloatWrapper(1.0))
+ assert v2.signature is v3.signature
+ v4 = ar.descr_add(space, ar)
+ assert v1.signature is v4.signature
\ No newline at end of file
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit