Commit 7e9d8345 authored by Ruben ten Hove's avatar Ruben ten Hove
Browse files

Merge branch 'pytest-cov' into 'main'

fix: use variable for pytest invocation; add PYTEST_COVERAGE_PATH variable

See merge request just-ci/templates!121
parents 308a2c58 feec3c96
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ variables:
  PYTEST_DEFAULT_ARGS:
    -vvv --capture=tee-sys -o log_cli=true -o log_cli_level=DEBUG --color=yes
  PYTEST_EXTRA_ARGS: ""
  PYTEST_INVOCATION: python3 -m pytest # Can be changed to "pytest"

python:pytest:
  extends: .python:pre-install
@@ -18,7 +19,7 @@ python:pytest:
  script:
    - !reference [".python:pre", script]
    - !reference [".python:pre-install", script]
    - python3 -m pytest --cov=${PYTHON_PACKAGE}
    - ${PYTEST_INVOCATION} --cov=${PYTEST_COVERAGE_PATH:-${PYTHON_PACKAGE:-.}}
      --cov-fail-under=${PYTEST_COVERAGE_THRESHOLD}
      --junitxml=${CI_PROJECT_DIR}/pytest-report.xml --cov-report
      xml:${CI_PROJECT_DIR}/pytest-coverage.xml -p no:cacheprovider