I’m running into the following problem/message: Coverage.py warning: No data was collected. (no-data-collected)
When I’m in a virtual environment (locally) and execute the following line (in the project root), everything seems to work and all the reports (junit AND coverage xml/html) are generated:
python -m pytest --junitxml=test-reports/test-results.xml --cov=./ --cov-report=xml --cov-report=html
I have the exact same line in my .circleci/config.yml file wich outputs the following:
it doesn’t fail, but it doesn’t generate the .coverage file so it can’t generate the reports.
I must have something to do with the difference between the venv and circle, but i can’t seem the find out what. Has anyone experieced this before?
.circleci/config.yml
version: 2.1
orbs:
codecov: codecov/codecov@1.0.4
jobs:
build:
docker:
- image: circleci/python:3.7.3
steps:
- checkout
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
cd BandManager
pip install -r requirements.txt
- run:
name: excute testrunner and coverage
command: |
. venv/bin/activate
cd BandManager
python -m pytest --junitxml=test-reports/test-results.xml --cov=./ --cov-report=xml --cov-report=html
- codecov/upload:
flags: backend