From cf42b0a0c0e1ccdbd1411a23f9918b8d94371b97 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 14 Sep 2013 14:08:56 +0200 Subject: [PATCH] clean up test a little --HG-- extra : rebase_source : 7b763fbb0f2485056ec4d2f53a5ec76dc7be9203 --- tests/run/extcmethod.pyx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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() -- 2.7.4