Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-test-timer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-test-timer

Print the amount of time that each unit test took

  • 0.0.2
  • PyPI
  • Socket score

Maintainers
1

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'...

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc