Skip to content

Commit 2ebce74

Browse files
Confirmed compatibility with Python 3.9. (#1270)
* Run tests against Python 3.9 * Don't let GitHub Actions cancel once the first job fails * [tests] Force mocked QuerySet's to be truthy Co-authored-by: Carlton Gibson <carlton@noumenal.es>
1 parent 85c9572 commit 2ebce74

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.github/workflows/tests.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ jobs:
66
tests:
77
runs-on: ubuntu-latest
88
strategy:
9+
fail-fast: false
910
matrix:
10-
python-version: [3.5, 3.6, 3.7, 3.8]
11+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9.0-rc - 3.9]
1112

1213
steps:
1314
- uses: actions/checkout@v2

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Full documentation on `read the docs`_.
2121
Requirements
2222
------------
2323

24-
* **Python**: 3.5, 3.6, 3.7, 3.8
24+
* **Python**: 3.5, 3.6, 3.7, 3.8, 3.9
2525
* **Django**: 2.2, 3.0, 3.1
2626
* **DRF**: 3.10+
2727

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
'Programming Language :: Python :: 3.6',
5353
'Programming Language :: Python :: 3.7',
5454
'Programming Language :: Python :: 3.8',
55+
'Programming Language :: Python :: 3.9',
5556
'Framework :: Django',
5657
],
5758
zip_safe=False,

tests/utils.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
from django.db import models
44

55

6+
class QuerySet(models.QuerySet):
7+
8+
def __bool__(self):
9+
return True
10+
11+
612
class MockQuerySet:
713
"""
814
Generate a mock that is suitably similar to a QuerySet
915
"""
1016

1117
def __new__(self):
12-
m = mock.Mock(spec_set=models.QuerySet())
18+
m = mock.Mock(spec_set=QuerySet())
1319
m.filter.return_value = m
1420
m.all.return_value = m
1521
return m

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
envlist =
33
{py35,py36,py37}-django22,
44
{py36,py37,py38}-django30,
5-
{py36,py37,py38}-django31,
6-
{py36,py37,py38}-latest,
5+
{py36,py37,py38,py39}-django31,
6+
{py36,py37,py38,py39}-latest,
77
isort,lint,docs,warnings,
88

99

0 commit comments

Comments
 (0)