module documentation

Profiling support for unit and performance tests. These are special purpose profiling methods which operate in a more fine-grained way than nose's profiling plugin.

Class ProfileStatsFile Store per-platform/fn profiling results in a file.
Function count_functions Undocumented
Function function_call_count Assert a target for a test case's function call count.
Function _start_current_test Undocumented
Variable _current_test String id of current test.
Variable _profile_stats global ProfileStatsFileInstance.
@contextlib.contextmanager
def count_functions(variance=0.05): (source)

Undocumented

def function_call_count(variance=0.05, times=1, warmup=0): (source)

Assert a target for a test case's function call count. The main purpose of this assertion is to detect changes in callcounts for various functions - the actual number is not as important. Callcounts are stored in a file keyed to Python version and OS platform information. This file is generated automatically for new tests, and versioned so that unexpected changes in callcounts will be detected.

def _start_current_test(id_): (source)

Undocumented

_current_test = (source)

String id of current test. plugin_base assigns this at the start of each test using _start_current_test.

_profile_stats = (source)

global ProfileStatsFileInstance. plugin_base assigns this at the start of all tests.