Skip to content

tox: testenv: use single command, settings via env #563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ matrix:
env: TOXENV=py36-dj20-postgres
- python: 3.6
env: TOXENV=py36-dj111-sqlite
- python: 3.6
env: TOXENV=py36-checkqa

- python: 3.5
env: TOXENV=py35-dj110-postgres
Expand All @@ -27,15 +25,16 @@ matrix:
env: TOXENV=py27-dj111-mysql_myisam
- python: 2.7
env: TOXENV=py27-dj18-postgres
- python: 2.7
env: TOXENV=py27-checkqa

# pypy/pypy3: not included with coverage reports (much slower then).
- python: pypy
env: TOXENV=pypy-dj111-sqlite_file
- python: pypy3
env: TOXENV=pypy3-dj110-sqlite

- python: 3.6
env: TOXENV=checkqa

allow_failures:
- env: TOXENV=py36-djmaster-postgres

Expand All @@ -58,7 +57,7 @@ install:
- pip install tox==2.9.1
- |
# Setup coverage tracking, but not with "checkqa" nor "pypy*".
if [[ "${TOXENV%-checkqa}" == "$TOXENV" ]] && [[ "${TOXENV#pypy}" == "$TOXENV" ]]; then
if [[ "$TOXENV" != "checkqa" ]] && [[ "${TOXENV#pypy}" == "$TOXENV" ]]; then
PYTEST_DJANGO_COVERAGE=1
export PYTEST_ADDOPTS='--cov=pytest_django --cov=tests --cov=pytest_django_test --cov-report=term-missing:skip-covered'
export _PYTESTDJANGO_TOX_EXTRA_DEPS=pytest-cov
Expand Down
23 changes: 14 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ deps =
pytest-xdist==1.15
{env:_PYTESTDJANGO_TOX_EXTRA_DEPS:}

checkqa: flake8

djmaster: https://github.com/django/django/archive/master.tar.gz
dj20: Django>=2.0a1,<2.1
dj111: Django>=1.11,<1.12
Expand All @@ -35,16 +33,23 @@ setenv =
COV_CORE_CONFIG={toxinidir}/.coveragerc
COV_CORE_DATAFILE={toxinidir}/.coverage.eager

mysql_innodb: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql_innodb
mysql_myisam: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql_myisam
postgres: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_postgres
sqlite: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
sqlite_file: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite_file

passenv = PYTEST_ADDOPTS
usedevelop = True
commands =
checkqa: flake8 --version
checkqa: flake8 --show-source --statistics {posargs:pytest_django pytest_django_test}
mysql_innodb: pytest --ds=pytest_django_test.settings_mysql_innodb --strict {posargs:tests}
mysql_myisam: pytest --ds=pytest_django_test.settings_mysql_myisam --strict {posargs:tests}
postgres: pytest --ds=pytest_django_test.settings_postgres --strict {posargs:tests}
sqlite: pytest --ds=pytest_django_test.settings_sqlite --strict {posargs:tests}
sqlite_file: pytest --ds=pytest_django_test.settings_sqlite_file --strict {posargs:tests}
pytest --strict {posargs:tests}

[testenv:checkqa]
deps =
flake8
commands =
flake8 --version
flake8 --show-source --statistics {posargs:pytest_django pytest_django_test}

[testenv:doc8]
basepython = python3.6
Expand Down