
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
.. image:: https://travis-ci.org/realpython/django-slow-tests.svg?branch=master :target: https://travis-ci.org/realpython/django-slow-tests
.. image:: https://coveralls.io/repos/realpython/django-slow-tests/badge.svg?branch=master :target: https://coveralls.io/r/realpython/django-slow-tests?branch=master
.. image:: https://img.shields.io/pypi/v/django-slowtests.svg :target: https://pypi.python.org/pypi/django-slowtests/
.. image:: https://img.shields.io/badge/license-MIT-blue.svg :target: https://pypi.python.org/pypi/django-slowtests/
Welcome to the documentation for django-slowtests!
*Code tested on Django 1.6, 1.7, 1.8, 1.9, 1.10 and 1.11 with Python 2.7 and 3.6
Install::
$ pip install django-slowtests
Add the following settings::
TEST_RUNNER = 'django_slowtests.testrunner.DiscoverSlowestTestsRunner' NUM_SLOW_TESTS = 10
SLOW_TEST_THRESHOLD_MS = 200 # Only show tests slower than 200ms
ALWAYS_GENERATE_SLOW_REPORT = False # Generate report only when requested using --slowreport flag
Run test suite::
$ python manage.py test
3.1. Save report to file:: $ python manage.py test --slowreportpath report.json
3.2. Generating full reports to file:: In some situations, you may need to generate full tests reports. To do so, set NUM_SLOW_TESTS to None in your settings and run the following command: $ python manage.py test --slowreportpath report.json
Sample output::
Ran 10 tests in 0.413s
OK Destroying test database for alias 'default'...
Ten slowest tests: 0.3597s test_detail_view_with_a_future_poll (polls.tests.PollIndexDetailTests) 0.0284s test_detail_view_with_a_past_poll (polls.tests.PollIndexDetailTests) 0.0068s test_index_view_with_a_future_poll (polls.tests.PollViewTests) 0.0047s test_index_view_with_a_past_poll (polls.tests.PollViewTests) 0.0045s test_index_view_with_two_past_polls (polls.tests.PollViewTests) 0.0041s test_index_view_with_future_poll_and_past_poll (polls.tests.PollViewTests) 0.0036s test_index_view_with_no_polls (polls.tests.PollViewTests) 0.0003s test_was_published_recently_with_future_poll (polls.tests.PollMethodTests) 0.0002s test_was_published_recently_with_recent_poll (polls.tests.PollMethodTests) 0.0002s test_was_published_recently_with_old_poll (polls.tests.PollMethodTests)
You can run the tests via::
$ python setup.py test
or::
$ make test
or::
$ make all
or::
$ python runtests.py
This code is distributed under the terms of the MIT license. See the LICENSE
file.
FAQs
locate your slowest tests
We found that django-slowtests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.