Skip to content

Commit a60cc25

Browse files
committed
Export COVERAGE_FILE and COVERAGE_PROCESS_START outside the command
On Windows you can't set env vars just before executing a command-line, so move the definition of those variables to the CI environment
1 parent a5df846 commit a60cc25

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ jobs:
8282
before_script:
8383
- |
8484
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
85-
export _PYTEST_TOX_COVERAGE_RUN="env COVERAGE_FILE=$PWD/.coverage COVERAGE_PROCESS_START=$PWD/.coveragerc coverage run --source {envsitepackagesdir}/_pytest/,$PWD/testing -m"
85+
export COVERAGE_FILE=$PWD/.coverage
86+
export COVERAGE_PROCESS_START=$PWD/.coveragerc
87+
export _PYTEST_TOX_COVERAGE_RUN="coverage run --source {envsitepackagesdir}/_pytest/,$PWD/testing -m"
8688
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
8789
fi
8890

scripts/prepare-coverage.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
if not defined PYTEST_NO_COVERAGE (
2-
set "_PYTEST_TOX_COVERAGE_RUN=coverage run --source {envsitepackagesdir}/_pytest/,%CD%/testing -m"
2+
set "COVERAGE_FILE=%CD%\.coverage"
3+
set "COVERAGE_PROCESS_START=%CD%\.coveragerc"
4+
set "_PYTEST_TOX_COVERAGE_RUN=coverage run --source {envsitepackagesdir}\_pytest\,%CD%\testing -m"
35
set "_PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess"
46
echo Coverage setup completed
57
) else (

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ envlist =
1919
[testenv]
2020
commands =
2121
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {posargs:testing}
22-
passenv = USER USERNAME
22+
passenv = USER USERNAME COVERAGE_FILE COVERAGE_PROCESS_START
2323
setenv =
2424
deps =
2525
hypothesis>=3.56

0 commit comments

Comments
 (0)