From: Stefan Behnel Date: Sat, 14 Sep 2013 12:08:56 +0000 (+0200) Subject: clean up test a little X-Git-Tag: 0.20b1~319 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf42b0a0c0e1ccdbd1411a23f9918b8d94371b97;p=platform%2Fupstream%2Fpython-cython.git clean up test a little --HG-- extra : rebase_source : 7b763fbb0f2485056ec4d2f53a5ec76dc7be9203 --- diff --git a/tests/run/extcmethod.pyx b/tests/run/extcmethod.pyx index 0f9f09e..18e1ed8 100644 --- a/tests/run/extcmethod.pyx +++ b/tests/run/extcmethod.pyx @@ -1,9 +1,11 @@ +# mode: run + cdef class Spam: cdef int tons cdef void add_tons(self, int x): - self.tons = self.tons + x + self.tons += x cdef void eat(self): self.tons = 0 @@ -11,10 +13,10 @@ cdef class Spam: def lift(self): print self.tons -cdef class SuperSpam(Spam): +cdef class SubSpam(Spam): cdef void add_tons(self, int x): - self.tons = self.tons + 2 * x + self.tons += 2 * x def test(): """ @@ -25,13 +27,13 @@ def test(): 5 """ cdef Spam s - cdef SuperSpam ss + cdef SubSpam ss s = Spam() s.eat() s.add_tons(5) s.lift() - ss = SuperSpam() + ss = SubSpam() ss.eat() ss.lift()