Skip to content

Merge master into features #3949

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CHANGELOG merge=union
*.bat text eol=crlf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ env/
.cache
.pytest_cache
.coverage
.coverage.*
coverage.xml
.ropeproject
.idea
.hypothesis
Expand Down
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

- stage: deploy
python: '3.6'
env:
env: PYTEST_NO_COVERAGE=1
install: pip install -U setuptools setuptools_scm
script: skip
deploy:
Expand All @@ -82,7 +82,9 @@ jobs:
before_script:
- |
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
export _PYTEST_TOX_COVERAGE_RUN="env COVERAGE_FILE=$PWD/.coverage COVERAGE_PROCESS_START=$PWD/.coveragerc coverage run --source {envsitepackagesdir}/_pytest/,$PWD/testing -m"
export COVERAGE_FILE="$PWD/.coverage"
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
export _PYTEST_TOX_COVERAGE_RUN="coverage run --source {envsitepackagesdir}/_pytest/,{toxinidir}/testing -m"
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
fi

Expand All @@ -94,9 +96,9 @@ after_success:
set -e
pip install codecov
coverage combine
coverage xml
coverage report -m
codecov --required -X gcov pycov search -f coverage.xml --flags ${TOXENV//-/ }
coverage xml --ignore-errors
coverage report -m --ignore-errors
codecov --required -X gcov pycov search -f coverage.xml --flags ${TOXENV//-/ } linux

# Coveralls does not support merged reports.
if [[ "$TOXENV" = py37 ]]; then
Expand Down
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
.. image:: https://img.shields.io/pypi/pyversions/pytest.svg
:target: https://pypi.org/project/pytest/

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

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

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

.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg
:target: https://www.codetriage.com/pytest-dev/pytest
Expand Down
24 changes: 12 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
environment:
COVERALLS_REPO_TOKEN:
secure: 2NJ5Ct55cHJ9WEg3xbSqCuv0rdgzzb6pnzOIG5OkMbTndw3wOBrXntWFoQrXiMFi
# this is pytest's token in coveralls.io, encrypted
# using pytestbot account as detailed here:
# https://www.appveyor.com/docs/build-configuration#secure-variables

matrix:
# coveralls is not in the default env list
- TOXENV: "coveralls"
# note: please use "tox --listenvs" to populate the build matrix below
- TOXENV: "linting"
PYTEST_NO_COVERAGE: "1"
- TOXENV: "py27"
- TOXENV: "py34"
- TOXENV: "py35"
- TOXENV: "py36"
- TOXENV: "py37"
- TOXENV: "pypy"
- TOXENV: "py27-pexpect"
PYTEST_NO_COVERAGE: "1"
- TOXENV: "py27-xdist"
- TOXENV: "py27-trial"
- TOXENV: "py27-numpy"
- TOXENV: "py27-pluggymaster"
- TOXENV: "py36-pexpect"
- TOXENV: "py36-xdist"
- TOXENV: "py36-trial"
- TOXENV: "py36-numpy"
- TOXENV: "py36-pluggymaster"
- TOXENV: "py27-nobyte"
- TOXENV: "doctesting"
- TOXENV: "py36-freeze"
PYTEST_NO_COVERAGE: "1"
- TOXENV: "docs"
PYTEST_NO_COVERAGE: "1"

install:
- echo Installed Pythons
- dir c:\Python*

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

- C:\Python36\python -m pip install --upgrade pip
- C:\Python36\python -m pip install --upgrade --pre tox

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

before_test:
- call scripts\prepare-coverage.bat

test_script:
- call scripts\call-tox.bat
- C:\Python36\python -m tox

on_success:
- call scripts\upload-coverage.bat

cache:
- '%LOCALAPPDATA%\pip\cache'
Expand Down
8 changes: 0 additions & 8 deletions scripts/call-tox.bat

This file was deleted.

10 changes: 10 additions & 0 deletions scripts/prepare-coverage.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
REM scripts called by AppVeyor to setup the environment variables to enable coverage
if not defined PYTEST_NO_COVERAGE (
set "COVERAGE_FILE=%CD%\.coverage"
set "COVERAGE_PROCESS_START=%CD%\.coveragerc"
set "_PYTEST_TOX_COVERAGE_RUN=coverage run --source {envsitepackagesdir}/_pytest/,{toxinidir}/testing -m"
set "_PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess"
echo Coverage setup completed
) else (
echo Skipping coverage setup, PYTEST_NO_COVERAGE is set
)
11 changes: 11 additions & 0 deletions scripts/upload-coverage.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
REM script called by AppVeyor to combine and upload coverage information to codecov
if not defined PYTEST_NO_COVERAGE (
echo Prepare to upload coverage information
C:\Python36\Scripts\pip install codecov
C:\Python36\Scripts\coverage combine
C:\Python36\Scripts\coverage xml --ignore-errors
C:\Python36\Scripts\coverage report -m --ignore-errors
C:\Python36\Scripts\codecov --required -X gcov pycov search -f coverage.xml --flags %TOXENV:-= % windows
) else (
echo Skipping coverage upload, PYTEST_NO_COVERAGE is set
)
3 changes: 0 additions & 3 deletions testing/python/metafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ class A(object):
@hypothesis.settings(
deadline=400.0
) # very close to std deadline and CI boxes are not reliable in CPU power
@pytest.mark.xfail(
sys.platform.startswith("win32"), reason="flaky #3707", strict=False
)
def test_idval_hypothesis(self, value):
from _pytest.python import _idval

Expand Down
38 changes: 16 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ envlist =
docs

[testenv]
whitelist_externals = env
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {env:_PYTEST_TEST_OPTS:} {posargs:testing}
coverage: coverage report -m --skip-covered
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {posargs:testing}
passenv = USER USERNAME
setenv =
# configuration if a user runs tox with a "coverage" factor, for example "tox -e py36-coverage"
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
deps =
hypothesis>=3.56
nose
Expand All @@ -39,8 +40,9 @@ deps =
pytest-xdist>=1.13
mock
nose
passenv = USER USERNAME TRAVIS
commands =
pytest -n3 -ra --runpytest=subprocess {posargs:testing}
pytest -n auto -ra --runpytest=subprocess {posargs:testing}


[testenv:linting]
Expand All @@ -56,9 +58,10 @@ deps =
nose
hypothesis>=3.56
{env:_PYTEST_TOX_EXTRA_DEP:}
changedir=testing
whitelist_externals = env
passenv = USER USERNAME TRAVIS
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n8 -ra {posargs:.}
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n auto -ra {posargs:testing}

[testenv:py36-xdist]
deps = {[testenv:py27-xdist]deps}
Expand All @@ -70,6 +73,7 @@ platform = linux|darwin
deps =
pexpect
{env:_PYTEST_TOX_EXTRA_DEP:}
whitelist_externals = env
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra test_pdb.py test_terminal.py test_unittest.py

Expand All @@ -90,13 +94,16 @@ changedir=testing
setenv =
{[testenv]setenv}
PYTHONDONTWRITEBYTECODE=1
whitelist_externals = env
passenv = USER USERNAME TRAVIS
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n3 -ra {posargs:.}
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n auto -ra {posargs:.}

[testenv:py27-trial]
deps =
twisted
{env:_PYTEST_TOX_EXTRA_DEP:}
whitelist_externals = env
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra {posargs:testing/test_unittest.py}

Expand All @@ -108,6 +115,7 @@ commands = {[testenv:py27-trial]commands}
deps =
numpy
{env:_PYTEST_TOX_EXTRA_DEP:}
whitelist_externals = env
commands=
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra {posargs:testing/python/approx.py}

Expand Down Expand Up @@ -145,6 +153,7 @@ skipsdist = True
deps =
PyYAML
{env:_PYTEST_TOX_EXTRA_DEP:}
whitelist_externals = env
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra doc/en
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
Expand Down Expand Up @@ -177,21 +186,6 @@ commands =
{envpython} create_executable.py
{envpython} tox_run.py


[testenv:coveralls]
passenv = CI TRAVIS TRAVIS_* COVERALLS_REPO_TOKEN
usedevelop = True
changedir = .
deps =
{[testenv]deps}
coveralls
codecov
commands =
coverage run -m pytest testing
coverage report -m
coveralls
codecov

[testenv:release]
decription = do a release, required posarg of the version number
basepython = python3.6
Expand Down