[pypy-svn] r74041 - pypy/trunk/pypy/annotation/test

benjamin at codespeak.net benjamin at codespeak.net
Sat Apr 24 23:36:35 CEST 2010


Author: benjamin
Date: Sat Apr 24 23:36:30 2010
New Revision: 74041

Modified:
   pypy/trunk/pypy/annotation/test/test_annrpython.py
Log:
test for staticmethod

Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py
==============================================================================
--- pypy/trunk/pypy/annotation/test/test_annrpython.py	(original)
+++ pypy/trunk/pypy/annotation/test/test_annrpython.py	Sat Apr 24 23:36:30 2010
@@ -223,6 +223,17 @@
         # result should be a list of integers
         assert listitem(s).knowntype == int
 
+    def test_staticmethod(self):
+        class X(object):
+            @staticmethod
+            def stat(value):
+                return value + 4
+        def f(v):
+            return X().stat(v)
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [int])
+        assert isinstance(s, annmodel.SomeInteger)
+
     def test_methodcall1(self):
         a = self.RPythonAnnotator()
         s = a.build_types(snippet._methodcall1, [int])



More information about the Pypy-commit mailing list