https://github.com/codecov/python-standard
Codecov coverage standard for Python
https://github.com/codecov/python-standard
codecov coverage-reports python
Last synced: about 1 month ago
JSON representation
Codecov coverage standard for Python
- Host: GitHub
- URL: https://github.com/codecov/python-standard
- Owner: codecov
- License: mit
- Created: 2019-06-25T23:01:03.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T14:50:22.000Z (5 months ago)
- Last Synced: 2025-04-11T15:10:25.616Z (about 1 month ago)
- Topics: codecov, coverage-reports, python
- Language: Python
- Homepage:
- Size: 463 KB
- Stars: 14
- Watchers: 9
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Python-Standard
[](https://github.com/codecov/python-standard/actions/workflows/python-standard.yml) [](https://codecov.io/gh/codecov/Python-Standard)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fpython-standard?ref=badge_shield)### Last Updated: 09/14/23 00:12:41
## What is this?
This is a **Python** application, with basic unit tests, for which coverage is uploaded to Codecov on a daily basis. It can also serve as an example for how to integrate Codecov into your Python project. If the build is passing for this project, then Codecov's Python report processing is functional and correct on codecov.io.
## Configuration
This project is written in `Python 3.9`. Unit tests are written with the `pytest` framework and coverage reports are generated using the `pytest-cov` plugin.
Unit tests: `/test_index.py`
Inside `.github/workflows/python-standard.yml` file:
```yaml
- name: Install dependencies
run: |
pip install pytest-cov
pip install requests
- name: Run Script
run: |
pytest --cov=./ --cov-report=xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
```## Usage
Run unit tests inside a Docker container
```bash
docker-compose up
```Generate coverage reports via `pytest`
```bash
pytest --cov=./ --cov-report=xml
```Uploading reports to Codecov
```bash
bash <(curl https://codecov.io/bash)OR
pip install codecov
codecov
```## Reporting Issues
If you've discovered an issue with this repository or with Python processing in general, it is recommended to email [email protected] rather than post an issue here. This repository will not be checked regularly for open issues.
## Contributing
Contributions are welcome! If you'd like to contribute to this repository, feel free to open a pull request or flag an issue. If you would like to contribute a new lanaguage standard, [you can get more information here](https://github.com/codecov/standards-scripts/blob/main/README.md#contributing).
## License
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fpython-standard?ref=badge_large)