{"id":13468766,"url":"https://github.com/pytest-dev/pytest-cov","last_synced_at":"2025-12-17T20:30:17.313Z","repository":{"id":16146163,"uuid":"18891741","full_name":"pytest-dev/pytest-cov","owner":"pytest-dev","description":"Coverage plugin for pytest.","archived":false,"fork":false,"pushed_at":"2025-04-05T14:07:55.000Z","size":1029,"stargazers_count":1864,"open_issues_count":148,"forks_count":213,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-05-06T01:58:35.142Z","etag":null,"topics":["pytest","python"],"latest_commit_sha":null,"homepage":"","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/pytest-dev.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-04-17T20:01:12.000Z","updated_at":"2025-05-05T22:50:01.000Z","dependencies_parsed_at":"2023-01-13T18:43:09.390Z","dependency_job_id":"3caa1e6d-fa53-496a-a2ea-84bfeb9dd950","html_url":"https://github.com/pytest-dev/pytest-cov","commit_stats":{"total_commits":880,"total_committers":94,"mean_commits":9.361702127659575,"dds":"0.49431818181818177","last_synced_commit":"76fe2a7e48e5c9c53644994c5ba5a421c84286f5"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cov","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cov/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cov/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cov/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pytest-dev","download_url":"https://codeload.github.com/pytest-dev/pytest-cov/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252606930,"owners_count":21775413,"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":["pytest","python"],"created_at":"2024-07-31T15:01:18.686Z","updated_at":"2025-12-17T20:30:17.305Z","avatar_url":"https://github.com/pytest-dev.png","language":"Python","readme":"========\nOverview\n========\n\n.. start-badges\n\n.. list-table::\n    :stub-columns: 1\n\n    * - docs\n      - |docs|\n    * - tests\n      - |github-actions|\n    * - package\n      - |version| |conda-forge| |wheel| |supported-versions| |supported-implementations| |commits-since|\n\n.. |docs| image:: https://readthedocs.org/projects/pytest-cov/badge/?style=flat\n    :target: https://readthedocs.org/projects/pytest-cov/\n    :alt: Documentation Status\n\n.. |github-actions| image:: https://github.com/pytest-dev/pytest-cov/actions/workflows/test.yml/badge.svg\n    :alt: GitHub Actions Status\n    :target: https://github.com/pytest-dev/pytest-cov/actions\n\n.. |version| image:: https://img.shields.io/pypi/v/pytest-cov.svg\n    :alt: PyPI Package latest release\n    :target: https://pypi.org/project/pytest-cov\n\n.. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/pytest-cov.svg\n    :target: https://anaconda.org/conda-forge/pytest-cov\n.. |wheel| image:: https://img.shields.io/pypi/wheel/pytest-cov.svg\n    :alt: PyPI Wheel\n    :target: https://pypi.org/project/pytest-cov\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pytest-cov.svg\n    :alt: Supported versions\n    :target: https://pypi.org/project/pytest-cov\n\n.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/pytest-cov.svg\n    :alt: Supported implementations\n    :target: https://pypi.org/project/pytest-cov\n\n.. |commits-since| image:: https://img.shields.io/github/commits-since/pytest-dev/pytest-cov/v7.0.0.svg\n    :alt: Commits since latest release\n    :target: https://github.com/pytest-dev/pytest-cov/compare/v7.0.0...master\n\n.. end-badges\n\nThis plugin provides coverage functionality as a pytest plugin. Compared to just using ``coverage run`` this plugin does some extras:\n\n* Automatic erasing and combination of .coverage files and default reporting.\n* Support for detailed coverage contexts (add ``--cov-context=test`` to have the full test name including parametrization as the context).\n* Xdist support: you can use all of pytest-xdist's features including remote interpreters and still get coverage.\n* Consistent pytest behavior. If you run ``coverage run -m pytest`` you will have slightly different ``sys.path`` (CWD will be\n  in it, unlike when running ``pytest``).\n\nAll features offered by the coverage package should work, either through pytest-cov's command line options or\nthrough coverage's config file.\n\n* Free software: MIT license\n\nInstallation\n============\n\nInstall with pip::\n\n    pip install pytest-cov\n\nFor distributed testing support install pytest-xdist::\n\n    pip install pytest-xdist\n\nUpgrading from pytest-cov 6.3\n-----------------------------\n\n`pytest-cov 6.3` and older were using a ``.pth`` file to enable coverage measurements in subprocesses. This was removed in `pytest-cov 7` - use `coverage's patch options \u003chttps://coverage.readthedocs.io/en/latest/config.html#run-patch\u003e`_ to enable subprocess measurements.\n\nUninstalling\n------------\n\nUninstall with pip::\n\n    pip uninstall pytest-cov\n\nUnder certain scenarios a stray ``.pth`` file may be left around in site-packages.\n\n* `pytest-cov 2.0` may leave a ``pytest-cov.pth`` if you installed without wheels\n  (``easy_install``, ``setup.py install`` etc).\n* `pytest-cov 1.8 or older` will leave a ``init_cov_core.pth``.\n\nUsage\n=====\n\n::\n\n    pytest --cov=myproj tests/\n\nWould produce a report like::\n\n    -------------------- coverage: ... ---------------------\n    Name                 Stmts   Miss  Cover\n    ----------------------------------------\n    myproj/__init__          2      0   100%\n    myproj/myproj          257     13    94%\n    myproj/feature4286      94      7    92%\n    ----------------------------------------\n    TOTAL                  353     20    94%\n\nDocumentation\n=============\n\nhttps://pytest-cov.readthedocs.io/en/latest/\n\n\nCoverage Data File\n==================\n\nThe data file is erased at the beginning of testing to ensure clean data for each test run. If you\nneed to combine the coverage of several test runs you can use the ``--cov-append`` option to append\nthis coverage data to coverage data from previous test runs.\n\nThe data file is left at the end of testing so that it is possible to use normal coverage tools to\nexamine it.\n\nLimitations\n===========\n\nFor distributed testing the workers must have the pytest-cov package installed. This is needed since\nthe plugin must be registered through setuptools for pytest to start the plugin on the\nworker.\n\nSecurity\n========\n\nTo report a security vulnerability please use the `Tidelift security contact \u003chttps://tidelift.com/security\u003e`_.\nTidelift will coordinate the fix and disclosure.\n\nAcknowledgements\n================\n\nWhilst this plugin has been built fresh from the ground up it has been influenced by the work done\non pytest-coverage (Ross Lawley, James Mills, Holger Krekel) and nose-cover (Jason Pellerin) which are\nother coverage plugins.\n\nNed Batchelder for coverage and its ability to combine the coverage results of parallel runs.\n\nHolger Krekel for pytest with its distributed testing support.\n\nJason Pellerin for nose.\n\nMichael Foord for unittest2.\n\nNo doubt others have contributed to these tools as well.\n","funding_links":["https://tidelift.com/security"],"categories":["Python","Testing Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-cov","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytest-dev%2Fpytest-cov","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-cov/lists"}