Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1799

Show
Ignore:
Timestamp:
10/28/07 13:45:18
Author:
fumanchu
Message:

Forward port to trunk of 3.0.x [1709]. Added code to print unreachable object typecounts. See #718.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_refleaks.py

    r1729 r1799  
    7373            return "\n".join(output) 
    7474        gc_stats.exposed = True 
     75         
     76        def gc_objtypes(self): 
     77           data = {} 
     78           for x in gc.get_objects(): 
     79               data[type(x)] = data.get(type(x), 0) + 1 
     80             
     81           data = [(v, k) for k, v in data.iteritems()] 
     82           data.sort() 
     83           return "\n".join([repr(pair) for pair in data]) 
     84        gc_objtypes.exposed = True  
    7585     
    7686    cherrypy.tree.mount(Root()) 
     
    99109        self.getPage("/gc_stats") 
    100110        self.assertBody("") 
     111         
     112        if self.body != "": 
     113            # If gc_stats fails, choose "ignore" to see the type counts for 
     114            # all the unreachable objects in this body. 
     115            self.getPage("/gc_objtypes") 
     116            print self.body 
    101117 
    102118 

Hosted by WebFaction

Log in as guest/cpguest to create tickets