def testBorrowed(self): self.assertEquals(memprof.getCounter(), 0) c = memprof.ConsumptionUnit() d = c.meAgain() del d del c self.assertEquals(memprof.getCounter(), 0)
def testNotKeepAlive(self): self.assertEquals(memprof.getCounter(), 0) c = memprof.ConsumptionUnit() d = c.notMe() self.assertEquals(memprof.getCounter(), 2) del c self.assertEquals(memprof.getCounter(), 1) del d self.assertEquals(memprof.getCounter(), 0)