diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000..7c9d550 --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,48 @@ +name: Python Tests + +on: + pull_request: + +jobs: + run-tests: + name: Run unit tests + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + + - name: Run tests + run: ./scripts/run_pytest.sh + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-report + path: | + coverage.xml + htmlcov/ diff --git a/tests/test_test_run_execution.py b/tests/test_test_run_execution.py index f66c251..3b6141b 100644 --- a/tests/test_test_run_execution.py +++ b/tests/test_test_run_execution.py @@ -693,8 +693,12 @@ def test_test_run_execution_log_whitespace_content( # Assert assert result.exit_code == 0 + # Click prepends a DeprecationWarning line for deprecated options; strip it before comparing + output_without_warning = "\n".join( + line for line in result.output.splitlines() if not line.startswith("DeprecationWarning:") + ) # Should still output the whitespace content as-is - assert result.output.strip() == log_content.rstrip() + assert output_without_warning.strip() == log_content.rstrip() def test_test_run_execution_log_generic_exception( self,