{"id":13814059,"url":"https://github.com/realpython/django-slow-tests","last_synced_at":"2025-04-05T01:07:27.676Z","repository":{"id":17587506,"uuid":"20391060","full_name":"realpython/django-slow-tests","owner":"realpython","description":"Locate your slowest tests.","archived":false,"fork":false,"pushed_at":"2021-11-23T00:28:05.000Z","size":5829,"stargazers_count":180,"open_issues_count":8,"forks_count":26,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-29T00:11:15.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"acemod/ACEX_artillery","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/realpython.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-02T02:10:20.000Z","updated_at":"2025-01-12T18:58:39.000Z","dependencies_parsed_at":"2022-09-26T21:31:40.930Z","dependency_job_id":null,"html_url":"https://github.com/realpython/django-slow-tests","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realpython%2Fdjango-slow-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realpython%2Fdjango-slow-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realpython%2Fdjango-slow-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realpython%2Fdjango-slow-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realpython","download_url":"https://codeload.github.com/realpython/django-slow-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271530,"owners_count":20911587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:01:41.597Z","updated_at":"2025-04-05T01:07:27.658Z","avatar_url":"https://github.com/realpython.png","language":"Python","readme":"django-slowtests\n========================\n\n.. image:: https://travis-ci.org/realpython/django-slow-tests.svg?branch=master\n    :target: https://travis-ci.org/realpython/django-slow-tests\n\n.. image:: https://coveralls.io/repos/realpython/django-slow-tests/badge.svg?branch=master\n  :target: https://coveralls.io/r/realpython/django-slow-tests?branch=master\n\n.. image:: https://img.shields.io/pypi/v/django-slowtests.svg\n    :target:  https://pypi.python.org/pypi/django-slowtests/\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n    :target:  https://pypi.python.org/pypi/django-slowtests/\n\nWelcome!\n--------\n\nWelcome to the documentation for django-slowtests!\n\n*Code tested on Django 1.6, 1.7, 1.8, 1.9, 1.10 and 1.11 with Python 2.7 and 3.6\n\n\nInstructions\n-------------\n\n1. Install::\n\n    $ pip install django-slowtests\n\n2. Add the following settings::\n\n    TEST_RUNNER = 'django_slowtests.testrunner.DiscoverSlowestTestsRunner'\n    NUM_SLOW_TESTS = 10\n\n    # (Optional)\n    SLOW_TEST_THRESHOLD_MS = 200  # Only show tests slower than 200ms\n\n    # (Optional)\n    ALWAYS_GENERATE_SLOW_REPORT = False  # Generate report only when requested using --slowreport flag\n\n3. Run test suite::\n\n    $ python manage.py test\n\n\n3.1. Save report to file::\n    $ python manage.py test --slowreportpath report.json\n\n3.2. Generating full reports to file::\n    In some situations, you may need to generate full tests reports. To do so,\n    set NUM_SLOW_TESTS to None in your settings and run the following command:\n    $ python manage.py test --slowreportpath report.json\n\n\n4. Sample output::\n\n\n    $ python manage.py test\n    Creating test database for alias 'default'...\n    ..........\n    ----------------------------------------------------------------------\n    Ran 10 tests in 0.413s\n\n    OK\n    Destroying test database for alias 'default'...\n\n    Ten slowest tests:\n    0.3597s test_detail_view_with_a_future_poll (polls.tests.PollIndexDetailTests)\n    0.0284s test_detail_view_with_a_past_poll (polls.tests.PollIndexDetailTests)\n    0.0068s test_index_view_with_a_future_poll (polls.tests.PollViewTests)\n    0.0047s test_index_view_with_a_past_poll (polls.tests.PollViewTests)\n    0.0045s test_index_view_with_two_past_polls (polls.tests.PollViewTests)\n    0.0041s test_index_view_with_future_poll_and_past_poll (polls.tests.PollViewTests)\n    0.0036s test_index_view_with_no_polls (polls.tests.PollViewTests)\n    0.0003s test_was_published_recently_with_future_poll (polls.tests.PollMethodTests)\n    0.0002s test_was_published_recently_with_recent_poll (polls.tests.PollMethodTests)\n    0.0002s test_was_published_recently_with_old_poll (polls.tests.PollMethodTests)\n\n\n\nRunning the Tests\n------------------------------------\n\nYou can run the tests via::\n\n    $ python setup.py test\n\nor::\n\n    $ make test\n\nor::\n\n    $ make all\n\nor::\n\n    $ python runtests.py\n\n\nKnown Issues\n------------\n\n\n\nLicense\n-------\n\nThis code is distributed under the terms of the MIT license. See the `LICENSE` file.\n","funding_links":[],"categories":["Testing","Python","测试"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealpython%2Fdjango-slow-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealpython%2Fdjango-slow-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealpython%2Fdjango-slow-tests/lists"}