def create_event_7():
    code_clone = models.Code()
    code_clone.co_name = 'b___'
    code_clone.co_filename = '/pycrunch_tracer/demo/demo_tree_v1.py'
    code_clone.co_argcount = 0

    sim_frame = models.Frame()
    sim_frame.f_lineno = 17
    sim_frame.f_locals = {'a': 1}
    sim_frame.f_code = code_clone
    evt = SimulationEvent(sim_frame, 'line', None)

    return evt
Пример #2
0
def create_event_6():
    code_clone = models.Code()
    code_clone.co_name = 'my_factorial'
    code_clone.co_filename = '/Users/gleb/code/pycrunch_tracing/pycrunch_tracer/demo/factorial_demo.py'
    code_clone.co_argcount = 1

    sim_frame = models.Frame()
    sim_frame.f_lineno = 11
    sim_frame.f_locals = {'num': 9}
    sim_frame.f_code = code_clone
    evt = SimulationEvent(sim_frame, 'line', None)

    return evt
def create_event_25():
    code_clone = models.Code()
    code_clone.co_name = 'stop'
    code_clone.co_filename = '/pycrunch_tracer/client/api/tracing.py'
    code_clone.co_argcount = 1

    sim_frame = models.Frame()
    sim_frame.f_lineno = 71
    sim_frame.f_locals = {'self': '< pycrunch_tracer.api.tracing'}
    sim_frame.f_code = code_clone
    evt = SimulationEvent(sim_frame, 'line', None)

    return evt