Skip to content

Commit d18f132

Browse files
committed
feat: add pytest-opt input to pass custom pytest options
1 parent dc5e2f5 commit d18f132

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ inputs:
5050
description: 'Path to check coverage (alternative to coverage-cov-path, to keep backward compatibility).'
5151
default: 'src'
5252
required: true
53+
pytest-opt:
54+
description: 'Additional options for pytest.'
55+
default: ''
56+
required: true
5357
coverage-push:
5458
description: 'Set 1 to push the coverage result to coverage branch.'
5559
default: '0'
@@ -183,8 +187,8 @@ runs:
183187
if [ "${{ inputs.pytest-separate-benchmark }}" = "1" ];then
184188
pytest_opt=("${pytest_opt[@]}" "--benchmark-disable")
185189
fi
186-
echo \$ $cmd_prefix pytest "${pytest_opt[@]}" "${{ inputs.pytest-tests-path }}"
187-
$cmd_prefix pytest "${pytest_opt[@]}" "${{ inputs.pytest-tests-path }}" | tee pytest-coverage.txt && status=0 || status=1
190+
echo \$ $cmd_prefix pytest "${pytest_opt[@]}" "${{ inputs.pytest-tests-path }}" "${{ inputs.pytest-opt }}"
191+
$cmd_prefix pytest "${pytest_opt[@]}" "${{ inputs.pytest-tests-path }}" "${{ inputs.pytest-opt }}"| tee pytest-coverage.txt && status=0 || status=1
188192
echo "status=$status" >> $GITHUB_OUTPUT
189193
shell: bash
190194
- name: Run benchmark test

0 commit comments

Comments
 (0)