File tree Expand file tree Collapse file tree 3 files changed +30
-13
lines changed Expand file tree Collapse file tree 3 files changed +30
-13
lines changed Original file line number Diff line number Diff line change 11[run]
22parallel = true
3- source = pytest_django
3+ source = pytest_django,pytest_django_test,tests
44branch = true
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ language: python
55matrix :
66 fast_finish : true
77 include :
8-
98 - python : 3.6
109 env : TOXENV=py36-pytest3-djangomaster-postgres
1110 - python : 3.6
@@ -70,12 +69,31 @@ install:
7069 - printf '\necho "Using pip-wrapper.." >&2\ntravis_retry pip "$@"' >> bin/travis_retry_pip
7170 - chmod +x bin/travis_retry_pip
7271 - sed -i.bak 's/^\[testenv\]/\0\ninstall_command = travis_retry_pip install {opts} {packages}/' tox.ini
73- - diff tox.ini tox.ini.bak && return 1 || true
74- - sed -i.bak 's/whitelist_externals =/\0\n travis_retry_pip/' tox.ini
75- - diff tox.ini tox.ini.bak && return 1 || true
72+ - if diff tox.ini tox.ini.bak; then exit 1; fi
73+ - printf '\nwhitelist_externals = travis_retry_pip' >> tox.ini
7674
7775 - pip install tox==2.7.0
76+ - |
77+ if [[ "${TOXENV%-checkqa}" == "$TOXENV" ]]; then
78+ export PYTEST_ADDOPTS='--cov=pytest_django --cov=tests --cov=pytest_django_test --cov-report=term-missing:skip-covered'
79+ export _PYTESTDJANGO_TOX_EXTRA_DEPS=pytest-cov
80+ fi
7881
7982script :
8083 - tox
8184 - " find ${TRAVIS_BUILD_DIR}/.tox -name 'log' -o -name '__pycache__' -type d | xargs -I {} rm -rf {}"
85+
86+ after_success :
87+ - |
88+ set -ex
89+ if [[ "${TOXENV%-checkqa}" == "$TOXENV" ]]; then
90+ pip install codecov
91+ coverage combine
92+ coverage xml
93+ coverage report -m --skip-covered
94+
95+ codecov_flags=${TOXENV//./}
96+ codecov_flags=${codecov_flags//-/ }
97+ codecov --required -X search gcov pycov -f coverage.xml --flags $codecov_flags
98+ fi
99+ set +x
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ envlist =
1414deps =
1515 django-configurations ==2.0
1616 pytest-xdist ==1.15
17+ {env:_PYTESTDJANGO_TOX_EXTRA_DEPS:}
1718
1819 checkqa: flake8
1920
@@ -31,17 +32,15 @@ deps =
3132
3233 pytest2: pytest>=2.9,<3.0
3334 pytest3: pytest>=3.0,<4.0
34-
3535setenv =
3636 PYTHONPATH = {toxinidir}:{env:PYTHONPATH:}
37-
37+ passenv = PYTEST_ADDOPTS
3838usedevelop = True
39-
4039commands =
4140 checkqa: flake8 --version
4241 checkqa: flake8 --show-source --statistics {posargs:pytest_django pytest_django_test}
43- mysql_innodb: py.test --ds =pytest_django_test.settings_mysql_innodb --strict -r fEsxXw {posargs:tests}
44- mysql_myisam: py.test --ds =pytest_django_test.settings_mysql_myisam --strict -r fEsxXw {posargs:tests}
45- postgres: py.test --ds =pytest_django_test.settings_postgres --strict -r fEsxXw {posargs:tests}
46- sqlite: py.test --ds =pytest_django_test.settings_sqlite --strict -r fEsxXw {posargs:tests}
47- sqlite_file: py.test --ds =pytest_django_test.settings_sqlite_file --strict -r fEsxXw {posargs:tests}
42+ mysql_innodb: pytest --ds =pytest_django_test.settings_mysql_innodb --strict -r fEsxXw {posargs:tests}
43+ mysql_myisam: pytest --ds =pytest_django_test.settings_mysql_myisam --strict -r fEsxXw {posargs:tests}
44+ postgres: pytest --ds =pytest_django_test.settings_postgres --strict -r fEsxXw {posargs:tests}
45+ sqlite: pytest --ds =pytest_django_test.settings_sqlite --strict -r fEsxXw {posargs:tests}
46+ sqlite_file: pytest --ds =pytest_django_test.settings_sqlite_file --strict -r fEsxXw {posargs:tests}
You can’t perform that action at this time.
0 commit comments