Pytest using pyproject.toml.

This commit is contained in:
Patrick Lehmann
2021-12-21 19:00:11 +01:00
parent 250cceb80d
commit bb855d572d
2 changed files with 22 additions and 6 deletions

View File

@@ -34,6 +34,11 @@ on:
required: false
default: '-r tests/requirements.txt'
type: string
unittest_directory:
description: 'Path to the directory containing unit tests.'
required: false
default: 'tests/unit'
type: string
artifact:
description: "Generate unit test report with junitxml and upload results as an artifact."
required: false
@@ -68,7 +73,7 @@ jobs:
- name: ☑ Run unit tests
run: |
[ 'x${{ inputs.artifact }}' != 'x' ] && PYTEST_ARGS='--junitxml=TestReport.xml' || unset PYTEST_ARGS
python -m pytest -rA tests/unit $PYTEST_ARGS --color=yes
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
- name: 📤 Upload 'TestReport.xml' artifact
if: inputs.artifact != ''