Skip to content

Commit bb2240f

Browse files
authored
Merge pull request #111 from kviktor/update-tests
Update tests and run them automatically
2 parents 02f007a + dce8b38 commit bb2240f

File tree

4 files changed

+50
-39
lines changed

4 files changed

+50
-39
lines changed

.github/workflows/tests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
max-parallel: 5
15+
matrix:
16+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install tox tox-gh-actions
29+
30+
- name: Run tests
31+
run: tox

runtests.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/settings.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8
2-
import django
3-
41
DEBUG = True
52
USE_TZ = True
63

@@ -23,7 +20,4 @@
2320

2421
SITE_ID = 1
2522

26-
if django.VERSION >= (1, 10):
27-
MIDDLEWARE = ()
28-
else:
29-
MIDDLEWARE_CLASSES = ()
23+
MIDDLEWARE = ()

tox.ini

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}-django-32
3+
django32-py{39,310}
4+
django42-py{39,310,311,312}
5+
django51-py{310,311,312,313}
6+
django52-py{310,311,312,313}
7+
8+
[gh-actions]
9+
python =
10+
3.9: py39
11+
3.10: py310
12+
3.11: py311
13+
3.12: py312
14+
3.13: py313
415

516
[testenv]
617
setenv =
718
PYTHONPATH = {toxinidir}:{toxinidir}/django_json_widget
8-
commands = coverage run --source django_json_widget runtests.py
19+
DJANGO_SETTINGS_MODULE=tests.settings
20+
commands = coverage run --source django_json_widget manage.py test -v 1
921
deps =
10-
django-32: Django>=3.2,<4.0
1122
-r{toxinidir}/requirements_test.txt
12-
basepython =
13-
py39: python3.9
14-
py38: python3.8
15-
py37: python3.7
16-
py36: python3.6
23+
django32: django~=3.2.0
24+
django42: django~=4.2.0
25+
django51: django~=5.1.0
26+
django52: django~=5.2.0

0 commit comments

Comments
 (0)