Prof: enable profiling using the hotshot profiler

This plugin will run tests using the hotshot profiler, which is part of the standard library. To turn it on, use the --with-profile option or set the NOSE_WITH_PROFILE environment variable. Profiler output can be controlled with the --profile-sort and --profile-restrict options, and the profiler output file may be changed with --profile-stats-file.

See the hotshot documentation in the standard library documentation for more details on the various output options.

Options

--with-profile

Enable plugin Profile: Use this plugin to run tests using the hotshot profiler. [NOSE_WITH_PROFILE]

--profile-sort=SORT

Set sort order for profiler output

--profile-stats-file=FILE

Profiler stats file; default is a new temp file on each run

--profile-restrict=RESTRICT

Restrict profiler output. See help for pstats.Stats for details

Plugin

class nose.plugins.prof.Profile

Bases: nose.plugins.base.Plugin

Use this plugin to run tests using the hotshot profiler.

begin()

Create profile stats file and load profiler.

configure(options, conf)

Configure plugin.

finalize(result)

Clean up stats file, if configured to do so.

options(parser, env)

Register commandline options.

prepareTest(test)

Wrap entire test run in prof.runcall().

report(stream)

Output profiler report.

Source

Table Of Contents

Previous topic

Multiprocess: parallel testing

Next topic

Skip: mark tests as skipped

This Page