From cfdb924ba5cf1a25b0b0d1b57624b7912e6bd695 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Tue, 19 Mar 2024 20:49:48 +0000 Subject: [PATCH] Catch warnings as errors in pytest --- .github/workflows/ci.yml | 2 ++ pyproject.toml | 1 + tests/settings.py | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddf5b23e..d7e2c96d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,8 @@ jobs: run: poetry run pre-commit run --all-files - name: Run Tests (Django ${{ steps.poetry-install.outputs.django_version }}) + # enforce failing fast: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference + shell: bash run: | poetry run pytest \ --junitxml=pytest.xml \ diff --git a/pyproject.toml b/pyproject.toml index 265e4683..1cdbaaff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ asyncio_mode = "auto" addopts = [ "--ds=tests.settings", # Forces pytest-django to use test settings "--ignore-glob='*/models.py'", + "-W error", ] [tool.ruff] diff --git a/tests/settings.py b/tests/settings.py index 5343512c..ca3b85c4 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -112,8 +112,6 @@ USE_I18N = True -USE_L10N = True - USE_TZ = True