Back to index

python3.2  3.2.2
Public Member Functions
test.test_pstats.AddCallersTestCase Class Reference

List of all members.

Public Member Functions

def test_combine_results

Detailed Description

Tests for pstats.add_callers helper.

Definition at line 8 of file test_pstats.py.


Member Function Documentation

Definition at line 11 of file test_pstats.py.

00011 
00012     def test_combine_results(self):
00013         # pstats.add_callers should combine the call results of both target
00014         # and source by adding the call time. See issue1269.
00015         # new format: used by the cProfile module
00016         target = {"a": (1, 2, 3, 4)}
00017         source = {"a": (1, 2, 3, 4), "b": (5, 6, 7, 8)}
00018         new_callers = pstats.add_callers(target, source)
00019         self.assertEqual(new_callers, {'a': (2, 4, 6, 8), 'b': (5, 6, 7, 8)})
00020         # old format: used by the profile module
00021         target = {"a": 1}
00022         source = {"a": 1, "b": 5}
00023         new_callers = pstats.add_callers(target, source)
00024         self.assertEqual(new_callers, {'a': 2, 'b': 5})
00025 

Here is the call graph for this function:


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