From 2ebce743d5facbe4fe628b79fa916a3f5ef09c21 Mon Sep 17 00:00:00 2001 From: Michael K Date: Wed, 23 Sep 2020 10:10:20 +0000 Subject: [PATCH] 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 --- .github/workflows/tests.yml | 3 ++- README.rst | 2 +- setup.py | 1 + tests/utils.py | 8 +++++++- tox.ini | 4 ++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 380683cc7..d4c1871e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/README.rst b/README.rst index db3eccc32..b8cadfac9 100644 --- a/README.rst +++ b/README.rst @@ -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+ diff --git a/setup.py b/setup.py index aa8d9c5d8..b9ae2141f 100644 --- a/setup.py +++ b/setup.py @@ -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, diff --git a/tests/utils.py b/tests/utils.py index e11410eb3..3a4bd2585 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -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 diff --git a/tox.ini b/tox.ini index e52b621ce..4e9a802aa 100644 --- a/tox.ini +++ b/tox.ini @@ -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,