Skip to content
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

Back to pytest-cov #658

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveragerc
@@ -1,6 +1,6 @@
[run]
parallel = 1
source = ${PYTESTDJANGO_COVERAGE_SRC}.
source = pytest_django,pytest_django_test,tests/
branch = 1

[report]
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -84,6 +84,7 @@ after_success:
- |
set -ex
if [[ "${TOXENV%-coverage}" != "$TOXENV" ]]; then
.tox/$TOXENV/bin/coverage xml
codecov_flags=${TOXENV%-coverage}
codecov_flags=${codecov_flags//-/,}
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X xcode -X gcovout -F "$codecov_flags"
Expand Down
20 changes: 10 additions & 10 deletions tox.ini
Expand Up @@ -21,7 +21,7 @@ deps =
mysql_innodb: mysql-python==1.2.5

postgres: psycopg2-binary
coverage: coverage-enable-subprocess
coverage: pytest-cov

setenv =
PYTHONPATH = {toxinidir}:{env:PYTHONPATH:}
Expand All @@ -32,19 +32,19 @@ setenv =
sqlite: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite
sqlite_file: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite_file

coverage: PYTESTDJANGO_TEST_RUNNER=coverage run -m pytest
coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc
coverage: COVERAGE_FILE={toxinidir}/.coverage
coverage: PYTESTDJANGO_COVERAGE_SRC={toxinidir}/
coverage: PYTESTDJANGO_TEST_ARGS=--cov --cov-report=term
coverage: COV_CORE_SOURCE={toxinidir}
coverage: COV_CORE_CONFIG={toxinidir}/.coveragerc
coverage: COV_CORE_DATAFILE={toxinidir}/.coverage.eager

passenv = PYTEST_ADDOPTS
usedevelop = True
commands =
coverage: coverage erase
{env:PYTESTDJANGO_TEST_RUNNER:pytest} {posargs:tests}
coverage: coverage combine
coverage: coverage report
coverage: coverage xml
pytest {env:PYTESTDJANGO_TEST_ARGS:} {posargs:tests}

# pytest-cov handles combining, but due to the eager setup there is an
# outer (empty) one, which we append (mainly for cleanup).
coverage: coverage combine -a

[testenv:checkqa]
deps =
Expand Down