Skip to content

Commit 2868b39

Browse files
committed
coverage: use modules for source
This should increase coverage for subprocesses, where previously `source` paths were used only from the config file, but not the initial `--source` argument.
1 parent 03eaad3 commit 2868b39

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.coveragerc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[run]
2-
source = _pytest,testing
2+
source = pytest,_pytest,testing/
33
parallel = 1
44
branch = 1
5+
6+
[paths]
7+
source = src/
8+
.tox/*/lib/python*/site-packages/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ before_script:
8484
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
8585
export COVERAGE_FILE="$PWD/.coverage"
8686
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
87-
export _PYTEST_TOX_COVERAGE_RUN="coverage run --source {envsitepackagesdir}/_pytest/,{toxinidir}/testing -m"
87+
export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
8888
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
8989
fi
9090

scripts/prepare-coverage.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ REM scripts called by AppVeyor to setup the environment variables to enable cove
22
if not defined PYTEST_NO_COVERAGE (
33
set "COVERAGE_FILE=%CD%\.coverage"
44
set "COVERAGE_PROCESS_START=%CD%\.coveragerc"
5-
set "_PYTEST_TOX_COVERAGE_RUN=coverage run --source {envsitepackagesdir}/_pytest/,{toxinidir}/testing -m"
5+
set "_PYTEST_TOX_COVERAGE_RUN=coverage run -m"
66
set "_PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess"
77
echo Coverage setup completed
88
) else (

0 commit comments

Comments
 (0)