Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_sys_settrace.JumpTracer Class Reference

List of all members.

Public Member Functions

def __init__
def trace

Public Attributes


Detailed Description

Defines a trace function that jumps from one place to another,
with the source and destination lines of the jump being defined by
the 'jump' property of the function under test.

Definition at line 461 of file

Constructor & Destructor Documentation

def test.test_sys_settrace.JumpTracer.__init__ (   self,

Definition at line 466 of file

00467     def __init__(self, function):
00468         self.function = function
00469         self.jumpFrom = function.jump[0]
00470         self.jumpTo = function.jump[1]
00471         self.done = False

Here is the caller graph for this function:

Member Function Documentation

def test.test_sys_settrace.JumpTracer.trace (   self,

Definition at line 472 of file

00473     def trace(self, frame, event, arg):
00474         if not self.done and frame.f_code == self.function.__code__:
00475             firstLine = frame.f_code.co_firstlineno
00476             if event == 'line' and frame.f_lineno == firstLine + self.jumpFrom:
00477                 # Cope with non-integer self.jumpTo (because of
00478                 # no_jump_to_non_integers below).
00479                 try:
00480                     frame.f_lineno = firstLine + self.jumpTo
00481                 except TypeError:
00482                     frame.f_lineno = self.jumpTo
00483                 self.done = True
00484         return self.trace
00486 # The first set of 'jump' tests are for things that are allowed:

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Definition at line 470 of file

Definition at line 467 of file

Definition at line 468 of file

Definition at line 469 of file

The documentation for this class was generated from the following file: