Skip to content

Commit

Permalink
Confirmed compatibility with Python 3.9. (#1270)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
michael-k and carltongibson committed Sep 23, 2020
1 parent 85c9572 commit 2ebce74
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Expand Up @@ -6,8 +6,9 @@ jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9.0-rc - 3.9]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -21,7 +21,7 @@ Full documentation on `read the docs`_.
Requirements
------------

* **Python**: 3.5, 3.6, 3.7, 3.8
* **Python**: 3.5, 3.6, 3.7, 3.8, 3.9
* **Django**: 2.2, 3.0, 3.1
* **DRF**: 3.10+

Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -52,6 +52,7 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Framework :: Django',
],
zip_safe=False,
Expand Down
8 changes: 7 additions & 1 deletion tests/utils.py
Expand Up @@ -3,13 +3,19 @@
from django.db import models


class QuerySet(models.QuerySet):

def __bool__(self):
return True


class MockQuerySet:
"""
Generate a mock that is suitably similar to a QuerySet
"""

def __new__(self):
m = mock.Mock(spec_set=models.QuerySet())
m = mock.Mock(spec_set=QuerySet())
m.filter.return_value = m
m.all.return_value = m
return m
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -2,8 +2,8 @@
envlist =
{py35,py36,py37}-django22,
{py36,py37,py38}-django30,
{py36,py37,py38}-django31,
{py36,py37,py38}-latest,
{py36,py37,py38,py39}-django31,
{py36,py37,py38,py39}-latest,
isort,lint,docs,warnings,


Expand Down

0 comments on commit 2ebce74

Please sign in to comment.