Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,32 @@ jobs:
python -m pip install -U pip
- run: pip install tox
- name: run tests
run: tox -e ${{ matrix.tox }} -- -m "not e2e"
run: tox -e ${{ matrix.tox }} -- -m "not e2e and not django"

django:
name: "django / ${{ matrix.django }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- {django: '4.2', tox: django42}
- {django: '5.2', tox: django52}
- {django: '6.0', tox: django60}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install tox
- name: run django tests
run: tox -e ${{ matrix.tox }}

typecheck:
name: "typecheck"
Expand Down
5 changes: 5 additions & 0 deletions emails/testsuite/django_/test_django_integrations.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import warnings
import pytest
import emails
import emails.message

django = pytest.importorskip("django")
from emails.django import DjangoMessage

pytestmark = pytest.mark.django


def test_django_message_proxy(django_email_backend):

Expand Down
2 changes: 2 additions & 0 deletions requirements/tests-django.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--requirement=base.txt
--requirement=tests-base.txt
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ignore_errors = true
norecursedirs = .* {arch} *.egg *.egg-info dist build requirements
markers =
e2e: tests that require a running SMTP server
django: tests that require Django

[coverage:run]
omit = emails/testsuite/*
Expand Down
23 changes: 22 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist = py310, py311, py312, py313, py314, pypy, style

[testenv]
passenv = TEST_*,SMTP_TEST_*
commands = py.test --cov-report term --cov-report html --cov emails {posargs}
commands = py.test --cov-report term --cov-report html --cov emails --cov-config=setup.cfg {posargs}

[testenv:pypy]
deps =
Expand All @@ -30,6 +30,27 @@ deps =
-rrequirements/tests.txt


[testenv:django42]
basepython = python3.12
deps =
-rrequirements/tests-django.txt
Django>=4.2,<4.3
commands = py.test --cov-report term --cov-report html --cov emails --cov-config=setup.cfg -m django {posargs}

[testenv:django52]
basepython = python3.12
deps =
-rrequirements/tests-django.txt
Django>=5.2,<5.3
commands = py.test --cov-report term --cov-report html --cov emails --cov-config=setup.cfg -m django {posargs}

[testenv:django60]
basepython = python3.12
deps =
-rrequirements/tests-django.txt
Django>=6.0,<6.1
commands = py.test --cov-report term --cov-report html --cov emails --cov-config=setup.cfg -m django {posargs}

[testenv:typecheck]
deps = mypy
commands = mypy emails/
Expand Down
Loading