Skip to content

Commit 7834863

Browse files
authored
Give more helpful messages during CI failures. (#601)
1 parent 6645fbc commit 7834863

6 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎.github/workflows/smoke-test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Run unit tests with pytest / pytest-copie
4242
run: |
4343
git config --global init.defaultBranch main
44-
python -m pytest tests --python_version ${{ matrix.python-version }}
44+
python -m pytest tests -o log_cli=true -vv --python_version ${{ matrix.python-version }}
4545
- name: Send status to Slack app
4646
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
4747
id: slack

‎.github/workflows/testing-and-coverage.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
- name: Run unit tests with pytest / pytest-copie
3737
run: |
3838
git config --global init.defaultBranch main
39-
python -m pytest tests --python_version ${{ matrix.python-version }}
39+
python -m pytest tests -o log_cli=true -vv --python_version ${{ matrix.python-version }}

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ line-length = 110
6767
[tool.isort]
6868
profile = "black"
6969
line_length = 110
70+
71+
[tool.pytest.ini_options]
72+
log_cli_level = "INFO"

‎python-project-template/.github/workflows/smoke-test.yml.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
pip list
4141
- name: Run unit tests with pytest
4242
run: |
43-
python -m pytest
43+
python -m pytest -o log_cli=true -vv
4444
{%- if 'email' in failure_notification %}
4545
- name: Send status to author's email
4646
if: {% raw %}${{ failure() }} && github.event_name != 'workflow_dispatch' }}{% endraw %} # Only email if the workflow failed and was not manually started. Customize this as necessary.

‎python-project-template/.github/workflows/testing-and-coverage.yml.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
3434
- name: Run unit tests with pytest
3535
run: |
36-
python -m pytest --cov={{package_name}} --cov-report=xml
36+
python -m pytest -o log_cli=true -vv --cov={{package_name}} --cov-report=xml
3737
- name: Upload coverage report to codecov
3838
uses: codecov/codecov-action@v7
3939
with:

‎python-project-template/pyproject.toml.jinja‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ testpaths = [
7474
"docs",
7575
]
7676
addopts = "--doctest-modules --doctest-glob=*.rst"
77+
log_cli_level = "INFO"
7778

7879
{% if 'black' in enforce_style -%}
7980
[tool.black]

0 commit comments

Comments
 (0)