Back to index

python3.2  3.2.2
Public Member Functions
test.test_sys_setprofile.ProfileSimulatorTestCase Class Reference
Inheritance diagram for test.test_sys_setprofile.ProfileSimulatorTestCase:
Inheritance graph
[legend]
Collaboration diagram for test.test_sys_setprofile.ProfileSimulatorTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def new_watcher
def test_simple
def test_basic_exception
def test_caught_exception
def test_distant_exception
def check_events

Detailed Description

Definition at line 282 of file test_sys_setprofile.py.


Member Function Documentation

def test.test_sys_setprofile.TestCaseBase.check_events (   self,
  callable,
  expected 
) [inherited]

Definition at line 93 of file test_sys_setprofile.py.

00093 
00094     def check_events(self, callable, expected):
00095         events = capture_events(callable, self.new_watcher())
00096         if events != expected:
00097             self.fail("Expected events:\n%s\nReceived events:\n%s"
00098                       % (pprint.pformat(expected), pprint.pformat(events)))
00099 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 283 of file test_sys_setprofile.py.

00283 
00284     def new_watcher(self):
00285         return ProfileSimulator(self)

Here is the caller graph for this function:

Definition at line 294 of file test_sys_setprofile.py.

00294 
00295     def test_basic_exception(self):
00296         def f(p):
00297             1/0
00298         f_ident = ident(f)
00299         self.check_events(f, [(1, 'call', f_ident),
00300                               (1, 'return', f_ident),
00301                               ])

Here is the call graph for this function:

Definition at line 302 of file test_sys_setprofile.py.

00302 
00303     def test_caught_exception(self):
00304         def f(p):
00305             try: 1/0
00306             except: pass
00307         f_ident = ident(f)
00308         self.check_events(f, [(1, 'call', f_ident),
00309                               (1, 'return', f_ident),
00310                               ])

Here is the call graph for this function:

Definition at line 311 of file test_sys_setprofile.py.

00311 
00312     def test_distant_exception(self):
00313         def f():
00314             1/0
00315         def g():
00316             f()
00317         def h():
00318             g()
00319         def i():
00320             h()
00321         def j(p):
00322             i()
00323         f_ident = ident(f)
00324         g_ident = ident(g)
00325         h_ident = ident(h)
00326         i_ident = ident(i)
00327         j_ident = ident(j)
00328         self.check_events(j, [(1, 'call', j_ident),
00329                               (2, 'call', i_ident),
00330                               (3, 'call', h_ident),
00331                               (4, 'call', g_ident),
00332                               (5, 'call', f_ident),
00333                               (5, 'return', f_ident),
00334                               (4, 'return', g_ident),
00335                               (3, 'return', h_ident),
00336                               (2, 'return', i_ident),
00337                               (1, 'return', j_ident),
00338                               ])
00339 

Here is the call graph for this function:

Definition at line 286 of file test_sys_setprofile.py.

00286 
00287     def test_simple(self):
00288         def f(p):
00289             pass
00290         f_ident = ident(f)
00291         self.check_events(f, [(1, 'call', f_ident),
00292                               (1, 'return', f_ident),
00293                               ])


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