Skip to content

Commit 0fde43b

Browse files
authored
Merge pull request #563 from blueyed/tox-command
tox: testenv: use single command, settings via env
2 parents de3c79b + 444ba44 commit 0fde43b

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ matrix:
1111
env: TOXENV=py36-dj20-postgres
1212
- python: 3.6
1313
env: TOXENV=py36-dj111-sqlite
14-
- python: 3.6
15-
env: TOXENV=py36-checkqa
1614

1715
- python: 3.5
1816
env: TOXENV=py35-dj110-postgres
@@ -26,15 +24,16 @@ matrix:
2624
env: TOXENV=py27-dj111-mysql_myisam
2725
- python: 2.7
2826
env: TOXENV=py27-dj18-postgres
29-
- python: 2.7
30-
env: TOXENV=py27-checkqa
3127

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

34+
- python: 3.6
35+
env: TOXENV=checkqa
36+
3837
allow_failures:
3938
- env: TOXENV=py36-djmaster-postgres
4039

@@ -53,7 +52,7 @@ install:
5352
- pip install tox==2.9.1
5453
- |
5554
# Setup coverage tracking, but not with "checkqa" nor "pypy*".
56-
if [[ "${TOXENV%-checkqa}" == "$TOXENV" ]] && [[ "${TOXENV#pypy}" == "$TOXENV" ]]; then
55+
if [[ "$TOXENV" != "checkqa" ]] && [[ "${TOXENV#pypy}" == "$TOXENV" ]]; then
5756
PYTEST_DJANGO_COVERAGE=1
5857
export PYTEST_ADDOPTS='--cov=pytest_django --cov=tests --cov=pytest_django_test --cov-report=term-missing:skip-covered'
5958
export _PYTESTDJANGO_TOX_EXTRA_DEPS=pytest-cov

tox.ini

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ deps =
1313
pytest-xdist==1.15
1414
{env:_PYTESTDJANGO_TOX_EXTRA_DEPS:}
1515

16-
checkqa: flake8
17-
1816
djmaster: https://github.com/django/django/archive/master.tar.gz
1917
dj20: Django>=2.0a1,<2.1
2018
dj111: Django>=1.11,<1.12
@@ -34,16 +32,23 @@ setenv =
3432
COV_CORE_CONFIG={toxinidir}/.coveragerc
3533
COV_CORE_DATAFILE={toxinidir}/.coverage.eager
3634

35+
mysql_innodb: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql_innodb
36+
mysql_myisam: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql_myisam
37+
postgres: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_postgres
38+
sqlite: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
39+
sqlite_file: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite_file
40+
3741
passenv = PYTEST_ADDOPTS
3842
usedevelop = True
3943
commands =
40-
checkqa: flake8 --version
41-
checkqa: flake8 --show-source --statistics {posargs:pytest_django pytest_django_test}
42-
mysql_innodb: pytest --ds=pytest_django_test.settings_mysql_innodb --strict {posargs:tests}
43-
mysql_myisam: pytest --ds=pytest_django_test.settings_mysql_myisam --strict {posargs:tests}
44-
postgres: pytest --ds=pytest_django_test.settings_postgres --strict {posargs:tests}
45-
sqlite: pytest --ds=pytest_django_test.settings_sqlite --strict {posargs:tests}
46-
sqlite_file: pytest --ds=pytest_django_test.settings_sqlite_file --strict {posargs:tests}
44+
pytest --strict {posargs:tests}
45+
46+
[testenv:checkqa]
47+
deps =
48+
flake8
49+
commands =
50+
flake8 --version
51+
flake8 --show-source --statistics {posargs:pytest_django pytest_django_test}
4752

4853
[testenv:doc8]
4954
basepython = python3.6

0 commit comments

Comments
 (0)