添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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:

afbeelding.png 2583×1218 143 KB

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/[email protected]
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
afbeelding.png 3410×1154 103 KB

To me it looks like the orb does what it’s suppposed to do. There is just no coverage data.

Am i using the codecoverage correctly with Pytest when calling:
python -m pytest --junitxml=test-reports/test-results.xml --cov=./ --cov-report=xml --cov-report=html ?