From 417516c3787a5de0df0abdcc51a47c40ea411d0d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Aug 2018 20:05:31 +0200 Subject: [PATCH] squash! Travis: report coverage with all builds doctesting: remove changedir With coverage 5 we could use COVERAGE_RCFILE to make it find the .coveragerc, or we could add `--rcfile` to _PYTEST_TOX_COVERAGE_RUN, but I've thought that this should not be the job that has to test if `--pyargs` actually works. --- .travis.yml | 3 +-- tox.ini | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a1ed53fb..6fd95d401 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,9 +81,8 @@ jobs: before_script: - | if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then - export _PYTEST_TOX_COVERAGE_RUN="env COVERAGE_FILE=$PWD/.coverage coverage run --source {envsitepackagesdir}/_pytest/,$PWD/testing -m" + export _PYTEST_TOX_COVERAGE_RUN="env COVERAGE_FILE=$PWD/.coverage COVERAGE_PROCESS_START=$PWD/.coveragerc coverage run --source {envsitepackagesdir}/_pytest/,$PWD/testing -m" export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess - export COVERAGE_PROCESS_START="$PWD/.coveragerc" fi script: tox --recreate diff --git a/tox.ini b/tox.ini index fa4990c1a..fbc5d4779 100644 --- a/tox.ini +++ b/tox.ini @@ -21,11 +21,11 @@ commands = {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {env:_PYTEST_TEST_OPTS:} {posargs:testing} coverage: coverage report -m --skip-covered setenv = - coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -a -m - coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocesses + coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m + coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess coverage: COVERAGE_FILE={toxinidir}/.coverage coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc -passenv = USER USERNAME COVERAGE_PROCESS_START +passenv = USER USERNAME deps = hypothesis>=3.56 nose @@ -142,13 +142,11 @@ commands = [testenv:doctesting] basepython = python skipsdist = True -# ensure the given pyargs can't mean anything else -changedir = doc/ deps = PyYAML {env:_PYTEST_TOX_EXTRA_DEP:} commands = - {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra en + {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra doc/en {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest [testenv:regen]