Skip to content

Commit

Permalink
trying to set up a test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethlove committed Dec 4, 2023
1 parent 81f878d commit da70692
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ on: [pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
django-version: ["3.2", "4.2", "5.0"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install django django-rest-framework pytest pytest-django pytest-lazy-fixture pytest-cov
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install django~=${{ matrix.django-version }}
pip install django-rest-framework pytest pytest-django pytest-lazy-fixture pytest-cov
- name: Run pytest
env:
PYTHONPATH: tests/project/:src/
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ testing = [
"pytest-lazy-fixture",
"pytest-randomly",
"pytest-xdist",
"tox",
]

[project.urls]
Expand Down
20 changes: 14 additions & 6 deletions tests/project/settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import contextlib

from django.conf.global_settings import * # noqa: F401, F403
from django.contrib.messages import constants as message_constants

# Settings deleted to prevent RemovedInDjango 5.0 warnings
del CSRF_COOKIE_MASKED
del DEFAULT_FILE_STORAGE
del USE_L10N
del PASSWORD_RESET_TIMEOUT # pyright: ignore[reportUndefinedVariable]
del STATICFILES_STORAGE
del USE_DEPRECATED_PYTZ
REMOVED_SETTINGS = [
"CSRF_COOKIE_MASKED",
"DEFAULT_FILE_STORAGE",
"FORMS_URLFIELD_ASSUME_HTTPS",
"PASSWORD_RESET_TIMEOUT",
"STATICFILES_STORAGE",
"USE_DEPRECATED_PYTZ",
"USE_L10N",
]
for setting in REMOVED_SETTINGS:
with contextlib.suppress(NameError):
del globals()[setting]

DEBUG = False
TEMPLATE_DEBUG = DEBUG
Expand Down

0 comments on commit da70692

Please sign in to comment.