Skip to main content

Package for timing your tests.

Project description

testopwatch

Check how long each test takes and what test file is the slowest

 python manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
time_exec: 0.2517799s test_name: test_create_account (account.tests.test_account.AccountTests) OK
time_exec: 0.1164200s test_name: test_login (account.tests.test_account.AccountTests) OK
time_exec: 0.1113484s test_name: test_ping (account.tests.test_account.AccountTests) OK
time_exec: 0.0778311s test_name: test_activate (account.tests.test_account.AccountTests) OK
time_exec: 0.2358941s test_name: test_email_user (account.tests.test_account.AccountTests) OK
...
----------- Total test class times -----------
TestClass (account.tests.test_account.AccountTests) finished in 1.24016s
...

Instructions:

  1. Install

     pip install testopwatch
    
  2. in your settings.py add the following

    TIME_RUNNER = "testopwatch.DjangoTimeRunner"
    
  3. run your test with the built-in manager

     python manage.py test --failfast --parallel
    

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

testopwatch-0.1.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

testopwatch-0.1.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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