Skip to main content

A timer plugin for nosetests

Project description

A timer plugin for nosetests that answers the question: how much time does every test takes?

Install

pip install nose-timer

Usage

Run nosetests with the --with-timer flag, and you will see a list of the tests and the time spent by each one (in seconds):

myapp.tests.ABigTestCase.test_the_world_is_running: 56.0010s
myapp.tests.ABigTestCase.test_the_rest_of_the_galaxy_is_running: 2356.0010s

How do I show only the n slowest tests?

For example, to show only the 10 slowest tests, run nosetests with --timer-top-n flag.

nosetests --with-timer --timer-top-n 10

How do I color the output and have pretty colors?

You can highlight slower tests using --timer-ok and --timer-warning flags.

  • Tests which takes less time than --timer-ok will be highlighted green.

  • Tests which takes less time than --timer-warning will be highlighted yellow.

  • All other tests will be highlighted red.

License

nose-timer is an MIT/BSD dual-Licensed library.

Contribute

  • Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.

  • Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).

  • Write a test which shows that the bug was fixed or that the feature works as expected.

  • Send a pull request and bug the maintainer until it gets merged and published.

  • Make sure to add yourself to the author’s file in setup.py and the Contributors section below :)

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nose-timer-0.2.0.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file nose-timer-0.2.0.tar.gz.

File metadata

  • Download URL: nose-timer-0.2.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nose-timer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 48206a4250ab37f82b29ae23f84ff720c537b2ce2b468e9cbc8e0d887fc4bd03
MD5 dfafe4973743ef222894804a15fc1771
BLAKE2b-256 a1055bd3be05a5544d9b9d10e9c164556292dacb35166239a30d5cbc437cb2eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page