From 67e7f3872ff24295cc6eb9f042f6ef199592aa2b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 25 Dec 2017 17:11:34 +0100 Subject: [PATCH 1/2] tox: testenv: use single command, settings via env --- tox.ini | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index edd0f97ba..07368cb5f 100644 --- a/tox.ini +++ b/tox.ini @@ -35,16 +35,18 @@ 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:doc8] basepython = python3.6 From 444ba4470f4cec5a44910fb8d2466ea778117007 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 25 Dec 2017 17:27:29 +0100 Subject: [PATCH 2/2] tox/Travis: use separate checkqa testenv --- .travis.yml | 9 ++++----- tox.ini | 11 +++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d0b1e2eb..aa88f91b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -27,8 +25,6 @@ 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 @@ -36,6 +32,9 @@ matrix: - python: pypy3 env: TOXENV=pypy3-dj110-sqlite + - python: 3.6 + env: TOXENV=checkqa + allow_failures: - env: TOXENV=py36-djmaster-postgres @@ -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 diff --git a/tox.ini b/tox.ini index 07368cb5f..d520f0154 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -44,10 +42,15 @@ setenv = passenv = PYTEST_ADDOPTS usedevelop = True commands = - checkqa: flake8 --version - checkqa: flake8 --show-source --statistics {posargs:pytest_django pytest_django_test} 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 skip_install = true