[py-svn] r33961 - in py/dist/py/apigen: rest tracer
fijal at codespeak.net
fijal at codespeak.net
Tue Oct 31 16:00:40 CET 2006
Author: fijal
Date: Tue Oct 31 16:00:30 2006
New Revision: 33961
Modified:
py/dist/py/apigen/rest/genrest.py
py/dist/py/apigen/tracer/description.py
Log:
Added max calls flag.
Modified: py/dist/py/apigen/rest/genrest.py
==============================================================================
--- py/dist/py/apigen/rest/genrest.py (original)
+++ py/dist/py/apigen/rest/genrest.py Tue Oct 31 16:00:30 2006
@@ -389,4 +389,3 @@
mangled.append(line)
tbrest.append(LiteralBlock('\n'.join(mangled)))
return tbid, tbrest
-
Modified: py/dist/py/apigen/tracer/description.py
==============================================================================
--- py/dist/py/apigen/tracer/description.py (original)
+++ py/dist/py/apigen/tracer/description.py Tue Oct 31 16:00:30 2006
@@ -5,6 +5,8 @@
import types
import inspect
+MAX_CALL_SITES = 20
+
class CallStack(object):
def __init__(self, tb):
if isinstance(tb, py.code.Traceback):
@@ -126,9 +128,10 @@
self.inputcells[cell_num] = model.unionof(cell, self.inputcells[cell_num])
def consider_call_site(self, frame, cut_frame):
+ if len(self.call_sites) > MAX_CALL_SITES:
+ return
stack = [i[0] for i in inspect.stack()]
cs = cut_stack(stack, frame, cut_frame)
- #print cs, hash(cs), cs._getval()
self.call_sites[cs] = cs
def get_call_sites(self):
More information about the pytest-commit
mailing list