diff --git a/bin/test.sh b/bin/test.sh new file mode 100755 index 0000000..dbbebc6 --- /dev/null +++ b/bin/test.sh @@ -0,0 +1,19 @@ +#!/bin/env bash +set -e # Exit immediately if a command exits with a non-zero status. + +# Run tests and check code style. Executed from tox (see tox.ini) +# +# this is required due to an issue with generic types used in asgiref and +# pypy's support for them: +# https://github.com/django/asgiref/issues/393 + +echo "Running tox env $TOX_ENV_NAME" +if [[ $TOX_ENV_NAME = pypy* ]]; then + echo "Running tests without coverage" + pytest . +else + echo "Running tests with coverage" + pytest --cov-append . +fi +echo "Checking code style" +pycodestyle --exclude=urls.py,migrations,.ropeproject -v advanced_filters diff --git a/pytest.ini b/pytest.ini index f33770e..2d341e0 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,4 @@ DJANGO_SETTINGS_MODULE=tests.test_project.settings addopts = --cov=advanced_filters --cov-report=term-missing --doctest-modules testpaths = advanced_filters +pythonpath = . tests diff --git a/test-reqs.txt b/test-reqs.txt index 888cb93..ceef0c1 100644 --- a/test-reqs.txt +++ b/test-reqs.txt @@ -1,5 +1,5 @@ -coveralls -factory-boy==2.12.0 -pycodestyle==2.5.0 -pytest-django==3.9.0 -pytest-cov +coveralls==3.3.1 +factory-boy==3.3.0 +pycodestyle==2.10.0 +pytest-django==4.5.2 +pytest-cov==4.1.0 diff --git a/tox.ini b/tox.ini index 25371e0..4236a10 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = py{37,py37}-django{22,32} - py{38,py38,39}-django{22,32,40} + py{38,39}-django{22,32,40} + pypy38-django22 py310-django{32,40} report @@ -18,13 +19,13 @@ deps = depends = !report: clean - report: * + report: ALL parallel_show_output = true +allowlist_externals = bin/test.sh commands = - pytest --cov-append . - pycodestyle --exclude=urls.py,migrations,.ropeproject -v advanced_filters + bin/test.sh [gh-actions] python =