Commit be6e4c87 authored by Niko's avatar Niko Committed by Marcel Amirault

Further simplify pytest execution

Coverage is stored in .coverage and we don't need an intermediate file for this
parent 7ff7a135
...@@ -154,3 +154,23 @@ coverage-jdk11: ...@@ -154,3 +154,23 @@ coverage-jdk11:
reports: reports:
cobertura: build/cobertura.xml cobertura: build/cobertura.xml
``` ```
### Python example
The following [`gitlab-ci.yml`](../../../ci/yaml/README.md) example for Python uses [pytest-cov](https://pytest-cov.readthedocs.io/) to collect test coverage data and [coverage.py](https://coverage.readthedocs.io/) to convert the report to use full relative paths.
The information isn't displayed without the conversion.
This example assumes that the code for your package is in `src/` and your tests are in `tests.py`:
```yaml
run tests:
stage: test
image: python:3
script:
- pip install pytest pytest-cov
- pytest --cov=src/ tests.py
- coverage xml
artifacts:
reports:
cobertura: coverage.xml
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment