[py-svn] r8308 - py/dist/py/misc

hpk at codespeak.net hpk at codespeak.net
Sun Jan 16 17:32:01 CET 2005


Author: hpk
Date: Sun Jan 16 17:32:01 2005
New Revision: 8308

Modified:
   py/dist/py/misc/cache.py
Log:
fix BuildCostCache to deal with elapsed builttime being measured == 0 



Modified: py/dist/py/misc/cache.py
==============================================================================
--- py/dist/py/misc/cache.py	(original)
+++ py/dist/py/misc/cache.py	Sun Jan 16 17:32:01 2005
@@ -25,7 +25,7 @@
 
     def weight():
         def fget(self):
-            return self.num * self.oneweight
+            return (self.num * self.oneweight, self.num)
         return property(fget, None, None, "cumulative weight")
     weight = weight()
 
@@ -37,6 +37,9 @@
         return property(fget, None, None)
     value = value()
 
+    def __repr__(self):
+        return "<%s weight=%s>" % (self.__class__.__name__, self.weight) 
+
 class BasicCache(object):
     def __init__(self, maxentries=128):
         self.maxentries = maxentries



More information about the pytest-commit mailing list