pytest-coverage-commentator icon indicating copy to clipboard operation
pytest-coverage-commentator copied to clipboard

Pass in specific pytest command?

Open Freddie-Pike opened this issue 3 years ago • 1 comments

Is it possible to pass in a specifc pytest command? I'm running python in a docker environment so I need to pass in a custom command.

Freddie-Pike avatar May 19 '21 17:05 Freddie-Pike

Have the same issue. Found solution on similar GitHub Action: Pytest Coverage Comment The bottom example in readme shows how to use it when you running the pytest inside docker:

- name: Run unit tests (pytest)
  run: |
    docker run -v /tmp:/tmp $IMAGE_TAG python3 -m pytest --cov-report=term-missing:skip-covered --junitxml=/tmp/pytest.xml --cov=src tests/ | tee /tmp/pytest-coverage.txt

- name: Pytest coverage comment
  uses: MishaKav/[email protected]
  with:
    pytest-coverage-path: /tmp/pytest-coverage.txt
    junitxml-path: /tmp/pytest.xml

MishaKav avatar Jun 02 '21 20:06 MishaKav