Skip to content

Commit d12f46c

Browse files
Merge pull request #3949 from nicoddemus/merge-master-into-features
Merge master into features
2 parents f2a427d + c00d934 commit d12f46c

10 files changed

+63
-54
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CHANGELOG merge=union
1+
*.bat text eol=crlf

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ env/
3535
.cache
3636
.pytest_cache
3737
.coverage
38+
.coverage.*
39+
coverage.xml
3840
.ropeproject
3941
.idea
4042
.hypothesis

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565

6666
- stage: deploy
6767
python: '3.6'
68-
env:
68+
env: PYTEST_NO_COVERAGE=1
6969
install: pip install -U setuptools setuptools_scm
7070
script: skip
7171
deploy:
@@ -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/,{toxinidir}/testing -m"
8688
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
8789
fi
8890
@@ -94,9 +96,9 @@ after_success:
9496
set -e
9597
pip install codecov
9698
coverage combine
97-
coverage xml
98-
coverage report -m
99-
codecov --required -X gcov pycov search -f coverage.xml --flags ${TOXENV//-/ }
99+
coverage xml --ignore-errors
100+
coverage report -m --ignore-errors
101+
codecov --required -X gcov pycov search -f coverage.xml --flags ${TOXENV//-/ } linux
100102
101103
# Coveralls does not support merged reports.
102104
if [[ "$TOXENV" = py37 ]]; then

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
.. image:: https://img.shields.io/pypi/pyversions/pytest.svg
1616
:target: https://pypi.org/project/pytest/
1717

18-
.. image:: https://img.shields.io/coveralls/pytest-dev/pytest/master.svg
19-
:target: https://coveralls.io/r/pytest-dev/pytest
18+
.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/master/graph/badge.svg
19+
:target: https://codecov.io/gh/pytest-dev/pytest
20+
:alt: Code coverage Status
2021

2122
.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master
2223
:target: https://travis-ci.org/pytest-dev/pytest
@@ -25,7 +26,7 @@
2526
:target: https://ci.appveyor.com/project/pytestbot/pytest
2627

2728
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
28-
:target: https://github.com/ambv/black
29+
:target: https://github.com/ambv/black
2930

3031
.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg
3132
:target: https://www.codetriage.com/pytest-dev/pytest

appveyor.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
environment:
2-
COVERALLS_REPO_TOKEN:
3-
secure: 2NJ5Ct55cHJ9WEg3xbSqCuv0rdgzzb6pnzOIG5OkMbTndw3wOBrXntWFoQrXiMFi
4-
# this is pytest's token in coveralls.io, encrypted
5-
# using pytestbot account as detailed here:
6-
# https://www.appveyor.com/docs/build-configuration#secure-variables
7-
82
matrix:
9-
# coveralls is not in the default env list
10-
- TOXENV: "coveralls"
11-
# note: please use "tox --listenvs" to populate the build matrix below
123
- TOXENV: "linting"
4+
PYTEST_NO_COVERAGE: "1"
135
- TOXENV: "py27"
146
- TOXENV: "py34"
157
- TOXENV: "py35"
168
- TOXENV: "py36"
179
- TOXENV: "py37"
1810
- TOXENV: "pypy"
19-
- TOXENV: "py27-pexpect"
11+
PYTEST_NO_COVERAGE: "1"
2012
- TOXENV: "py27-xdist"
2113
- TOXENV: "py27-trial"
2214
- TOXENV: "py27-numpy"
2315
- TOXENV: "py27-pluggymaster"
24-
- TOXENV: "py36-pexpect"
2516
- TOXENV: "py36-xdist"
2617
- TOXENV: "py36-trial"
2718
- TOXENV: "py36-numpy"
2819
- TOXENV: "py36-pluggymaster"
2920
- TOXENV: "py27-nobyte"
3021
- TOXENV: "doctesting"
3122
- TOXENV: "py36-freeze"
23+
PYTEST_NO_COVERAGE: "1"
3224
- TOXENV: "docs"
25+
PYTEST_NO_COVERAGE: "1"
3326

3427
install:
3528
- echo Installed Pythons
3629
- dir c:\Python*
3730

3831
- if "%TOXENV%" == "pypy" call scripts\install-pypy.bat
3932

33+
- C:\Python36\python -m pip install --upgrade pip
4034
- C:\Python36\python -m pip install --upgrade --pre tox
4135

4236
build: false # Not a C# project, build stuff at the test step instead.
4337

38+
before_test:
39+
- call scripts\prepare-coverage.bat
40+
4441
test_script:
45-
- call scripts\call-tox.bat
42+
- C:\Python36\python -m tox
43+
44+
on_success:
45+
- call scripts\upload-coverage.bat
4646

4747
cache:
4848
- '%LOCALAPPDATA%\pip\cache'

scripts/call-tox.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/prepare-coverage.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REM scripts called by AppVeyor to setup the environment variables to enable coverage
2+
if not defined PYTEST_NO_COVERAGE (
3+
set "COVERAGE_FILE=%CD%\.coverage"
4+
set "COVERAGE_PROCESS_START=%CD%\.coveragerc"
5+
set "_PYTEST_TOX_COVERAGE_RUN=coverage run --source {envsitepackagesdir}/_pytest/,{toxinidir}/testing -m"
6+
set "_PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess"
7+
echo Coverage setup completed
8+
) else (
9+
echo Skipping coverage setup, PYTEST_NO_COVERAGE is set
10+
)

scripts/upload-coverage.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
REM script called by AppVeyor to combine and upload coverage information to codecov
2+
if not defined PYTEST_NO_COVERAGE (
3+
echo Prepare to upload coverage information
4+
C:\Python36\Scripts\pip install codecov
5+
C:\Python36\Scripts\coverage combine
6+
C:\Python36\Scripts\coverage xml --ignore-errors
7+
C:\Python36\Scripts\coverage report -m --ignore-errors
8+
C:\Python36\Scripts\codecov --required -X gcov pycov search -f coverage.xml --flags %TOXENV:-= % windows
9+
) else (
10+
echo Skipping coverage upload, PYTEST_NO_COVERAGE is set
11+
)

testing/python/metafunc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ class A(object):
211211
@hypothesis.settings(
212212
deadline=400.0
213213
) # very close to std deadline and CI boxes are not reliable in CPU power
214-
@pytest.mark.xfail(
215-
sys.platform.startswith("win32"), reason="flaky #3707", strict=False
216-
)
217214
def test_idval_hypothesis(self, value):
218215
from _pytest.python import _idval
219216

tox.ini

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ envlist =
1717
docs
1818

1919
[testenv]
20+
whitelist_externals = env
2021
commands =
21-
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {env:_PYTEST_TEST_OPTS:} {posargs:testing}
22-
coverage: coverage report -m --skip-covered
22+
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {posargs:testing}
23+
passenv = USER USERNAME
2324
setenv =
25+
# configuration if a user runs tox with a "coverage" factor, for example "tox -e py36-coverage"
2426
coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m
2527
coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
2628
coverage: COVERAGE_FILE={toxinidir}/.coverage
2729
coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc
28-
passenv = USER USERNAME
2930
deps =
3031
hypothesis>=3.56
3132
nose
@@ -39,8 +40,9 @@ deps =
3940
pytest-xdist>=1.13
4041
mock
4142
nose
43+
passenv = USER USERNAME TRAVIS
4244
commands =
43-
pytest -n3 -ra --runpytest=subprocess {posargs:testing}
45+
pytest -n auto -ra --runpytest=subprocess {posargs:testing}
4446

4547

4648
[testenv:linting]
@@ -56,9 +58,10 @@ deps =
5658
nose
5759
hypothesis>=3.56
5860
{env:_PYTEST_TOX_EXTRA_DEP:}
59-
changedir=testing
61+
whitelist_externals = env
62+
passenv = USER USERNAME TRAVIS
6063
commands =
61-
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n8 -ra {posargs:.}
64+
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n auto -ra {posargs:testing}
6265

6366
[testenv:py36-xdist]
6467
deps = {[testenv:py27-xdist]deps}
@@ -70,6 +73,7 @@ platform = linux|darwin
7073
deps =
7174
pexpect
7275
{env:_PYTEST_TOX_EXTRA_DEP:}
76+
whitelist_externals = env
7377
commands =
7478
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra test_pdb.py test_terminal.py test_unittest.py
7579

@@ -90,13 +94,16 @@ changedir=testing
9094
setenv =
9195
{[testenv]setenv}
9296
PYTHONDONTWRITEBYTECODE=1
97+
whitelist_externals = env
98+
passenv = USER USERNAME TRAVIS
9399
commands =
94-
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n3 -ra {posargs:.}
100+
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n auto -ra {posargs:.}
95101

96102
[testenv:py27-trial]
97103
deps =
98104
twisted
99105
{env:_PYTEST_TOX_EXTRA_DEP:}
106+
whitelist_externals = env
100107
commands =
101108
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra {posargs:testing/test_unittest.py}
102109

@@ -108,6 +115,7 @@ commands = {[testenv:py27-trial]commands}
108115
deps =
109116
numpy
110117
{env:_PYTEST_TOX_EXTRA_DEP:}
118+
whitelist_externals = env
111119
commands=
112120
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra {posargs:testing/python/approx.py}
113121

@@ -145,6 +153,7 @@ skipsdist = True
145153
deps =
146154
PyYAML
147155
{env:_PYTEST_TOX_EXTRA_DEP:}
156+
whitelist_externals = env
148157
commands =
149158
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra doc/en
150159
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
@@ -177,21 +186,6 @@ commands =
177186
{envpython} create_executable.py
178187
{envpython} tox_run.py
179188

180-
181-
[testenv:coveralls]
182-
passenv = CI TRAVIS TRAVIS_* COVERALLS_REPO_TOKEN
183-
usedevelop = True
184-
changedir = .
185-
deps =
186-
{[testenv]deps}
187-
coveralls
188-
codecov
189-
commands =
190-
coverage run -m pytest testing
191-
coverage report -m
192-
coveralls
193-
codecov
194-
195189
[testenv:release]
196190
decription = do a release, required posarg of the version number
197191
basepython = python3.6

0 commit comments

Comments
 (0)