Skip to main content

django-test-timer

Print the amount of time that each unit test took.

Tested with Django 1.11, Python 2.7

Install

pip install django-test-timer

Then in your Django settings

TEST_RUNNER = 'django_test_timer.TimedTestRunner'

Then run your tests as usual.

Settings

By default, all tests will be printed. To only print tests that take a certain amount of time, set the threshold in your settings.py

TIMED_TEST_THRESHOLD_SECS = 2.0

Example Output

>>> ./manage.py test
....
----------------------------------------------------------------------
Ran 5 tests

Tests Times (>0.0s):
  [2.09s] test_foo (main.tests.test_general.DemoTestCase)
  [1.004s] test_bar (main.tests.test_general.DemoTestCase)
  [0.0s] test_this (main.tests.test_general.DemoTestCase)
  [0.0s] test_that (main.tests.test_general.DemoTestCase)
  [0.0s] test_not_implemented_errors (main.tests.test_general.DemoTestCase)
  
  Destroying test database for alias 'default'...

Metadata

Release files for django-test-timer 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-test-timer 0.0.2
File Size Uploaded
django_test_timer-0.0.2.tar.gz 15.3 kB Details

Release files / django_test_timer-0.0.2.tar.gz

Download URL django_test_timer-0.0.2.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
89b95335a88f4a1d2d7f24c94c138830815736f4ea80e42edb12e53fbd3170ae
BLAKE2b-256 checksum
How to use checksums
1e43395e9a354d40f126b995bfb71f8608ecb0b87ff249d8316cd9f623d2800d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page