{"id":15472492,"url":"https://github.com/miketheman/pytest-execution-timer","last_synced_at":"2025-09-11T18:33:01.494Z","repository":{"id":37953276,"uuid":"441568020","full_name":"miketheman/pytest-execution-timer","owner":"miketheman","description":"Measure Pytest execution phases","archived":false,"fork":false,"pushed_at":"2024-10-08T11:33:27.000Z","size":20,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-28T11:41:52.584Z","etag":null,"topics":["black","performance-analysis","pytest","pytest-plugin","python","python3","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pytest-execution-timer/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miketheman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"miketheman"}},"created_at":"2021-12-24T22:58:28.000Z","updated_at":"2024-12-13T20:34:19.000Z","dependencies_parsed_at":"2023-01-31T02:00:31.764Z","dependency_job_id":"ff76dc07-b726-4678-a347-e39cc6bd0405","html_url":"https://github.com/miketheman/pytest-execution-timer","commit_stats":{"total_commits":5,"total_committers":3,"mean_commits":"1.6666666666666667","dds":0.6,"last_synced_commit":"f134251f2254e2c2b6c8169085e69c787ccb9545"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miketheman%2Fpytest-execution-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miketheman%2Fpytest-execution-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miketheman%2Fpytest-execution-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miketheman%2Fpytest-execution-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miketheman","download_url":"https://codeload.github.com/miketheman/pytest-execution-timer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232659739,"owners_count":18557106,"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":["black","performance-analysis","pytest","pytest-plugin","python","python3","testing","testing-tools"],"created_at":"2024-10-02T02:39:05.050Z","updated_at":"2025-01-06T01:21:58.268Z","avatar_url":"https://github.com/miketheman.png","language":"Python","funding_links":["https://github.com/sponsors/miketheman"],"categories":[],"sub_categories":[],"readme":"# pytest-execution-timer\n\n[![PyPI current version](https://img.shields.io/pypi/v/pytest-execution-timer.svg)](https://pypi.python.org/pypi/pytest-execution-timer)\n[![Python Support](https://img.shields.io/pypi/pyversions/pytest-execution-timer.svg)](https://pypi.python.org/pypi/pytest-execution-timer)\n[![Tests](https://github.com/miketheman/pytest-execution-timer/workflows/Python%20Tests/badge.svg)](https://github.com/miketheman/pytest-execution-timer/actions?query=workflow%3A%22Python+Tests%22)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/miketheman/pytest-execution-timer/main.svg)](https://results.pre-commit.ci/latest/github/miketheman/pytest-execution-timer/main)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA plugin to use with Pytest to measure execution time of tests.\n\nDistinctly different from the `--durations` option of pytest,\nthis plugin measures specific pytest startup/collection phases.\n\nLeverages `pytest` hooks to measure execution time of phases.\n\n---\n\n## Installation\n\nRequires:\n\n- Python 3.8 or later.\n- Pytest 6.2 or later.\n\nInstall the plugin with any approach for your project.\n\nSome examples:\n\n```shell\npip install pytest-execution-timer\n```\n\n```shell\npoetry add --dev pytest-execution-timer\n```\n\n```shell\npipenv install --dev pytest-execution-timer\n```\n\nOr add it to your `requirements.txt` file.\n\n## Usage\n\nEnable the plugin with the `--execution-timer` option when running `pytest`:\n\n```console\n$ pytest --execution-timer\n...\nDurations of pytest phases in seconds (min 100ms):\n0.662\tpytest_runtestloop\n```\n\nControl the threshold (default 100ms) by passing `--minimum-duration=\u003cvalue in ms\u003e`:\n\n```console\n$ pytest --execution-timer --minimum-duration=1000  # 1 second\n```\n\n## Understanding the output\n\nThe best ay to start is to compare the difference of the `pytest_runtestloop` duration\nand the overall duration of the test run. Example:\n\n```console\nDurations of pytest phases in seconds (min 100ms):\n0.666\tpytest_runtestloop\n====== 4 passed in 0.68s ======\n```\n\nIn this example, there's not much lost between the test run and the `pytest_runtestloop`\nmeaning that the startup and collection phases are not taking too much time.\n\nIf there's a larger difference in the timings,\nlook to other emitted phases to understand what's taking the most time.\n\nThese can then be examined directly,\nor use other tools like [profilers](https://docs.python.org/3/library/profile.html)\nor [import timings](https://docs.python.org/3/using/cmdline.html#cmdoption-X).\n\n## License\n\nDistributed under the terms of the MIT license,\n\"pytest-execution-timer\" is free and open source software.\nSee `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiketheman%2Fpytest-execution-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiketheman%2Fpytest-execution-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiketheman%2Fpytest-execution-timer/lists"}