Skip to content

Merge master into features #4887

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 65 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
32b85e4
ci: Travis: use xdist with pluggymaster jobs
blueyed Feb 26, 2019
904f1ca
ci: Travis: macos: use existing py37
blueyed Feb 26, 2019
f85f36e
AppVeyor: drop pluggymaster
blueyed Feb 13, 2019
4eb40ef
ci: azure: use xdist with pluggymaster
blueyed Feb 26, 2019
af706ed
Merge pull request #4835 from blueyed/travis-macos
nicoddemus Feb 26, 2019
7428064
Merge pull request #4836 from blueyed/travis-pluggymaster-xdist
nicoddemus Feb 26, 2019
d5d1903
Upload code coverage from azure
nicoddemus Feb 25, 2019
4d9296c
ci: Travis: use single install section
blueyed Feb 26, 2019
a419216
Merge pull request #4837 from blueyed/travis-install
blueyed Feb 26, 2019
ee62674
Merge pull request #4831 from nicoddemus/codocov-azure
nicoddemus Feb 26, 2019
3fbe100
ci: Travis: remove coverage from some jobs
blueyed Feb 26, 2019
86070f0
ci: AppVeyor: no coverage reporting
blueyed Feb 26, 2019
e3eb26f
ci: Travis: no coverage by default [skip appveyor]
blueyed Feb 26, 2019
9dcd6f2
Merge pull request #4839 from blueyed/less-cov
nicoddemus Feb 26, 2019
fb7ee7f
Add badge for azure pipelines
nicoddemus Feb 26, 2019
6bd77c0
Remove appveyor.yml and related scripts
nicoddemus Feb 26, 2019
cd9415b
Configure azure to enable coverage on PYTEST_COVERAGE=1, similar to T…
nicoddemus Feb 26, 2019
f1254c4
Merge pull request #4840 from nicoddemus/drop-appveyor
nicoddemus Feb 26, 2019
16cbb31
Document how to disable caching rewritten .pyc files to disk
nicoddemus Feb 26, 2019
b5cf613
coverage: use source=. and report.include
blueyed Feb 26, 2019
0138e9c
ci: coverage: remove --ignore-errors
blueyed Feb 27, 2019
5a0f379
ci: codecov: set name for uploads/builds
blueyed Feb 27, 2019
31174f3
.coveragerc: fix/tighten paths
blueyed Feb 27, 2019
fec656b
Apply suggestions from code review
blueyed Feb 27, 2019
1e2810e
tox: generic pexpect factor
blueyed Feb 27, 2019
ee95d66
coverage: run.include, drop --ignore-errors, codecov name
blueyed Feb 27, 2019
05bb5ff
Merge pull request #4842 from nicoddemus/disable-bytecode-writing
blueyed Feb 27, 2019
c1e3128
Merge pull request #4844 from blueyed/tox-pexpect
blueyed Feb 27, 2019
e711a6c
Merge pull request #4841 from blueyed/coverage-source
blueyed Feb 27, 2019
ccab469
Fix test_argcomplete: use python -m pytest
blueyed Feb 27, 2019
55b78ff
Merge pull request #4848 from blueyed/fix-test_argcomplete
nicoddemus Feb 27, 2019
9c590fa
ci: Travis: skip coverage with cron runs
blueyed Feb 28, 2019
8b44787
ci: codecov: remove flags completely for now
blueyed Feb 28, 2019
df8869c
Merge pull request #4858 from blueyed/codecov-remove-flags
nicoddemus Feb 28, 2019
c30ab10
tox: add generic nobyte and numpy factors
blueyed Feb 28, 2019
5061031
Merge pull request #4859 from blueyed/tox-py27-nobyte-xdist
nicoddemus Mar 1, 2019
276ffa8
Merge pull request #4856 from blueyed/travis-no-cov-with-cron
nicoddemus Mar 1, 2019
a51dc0c
Validate type with writing to captured output like without
blueyed Mar 1, 2019
33db5e0
Tweak changelog
nicoddemus Mar 1, 2019
0dd4cb0
Merge pull request #4862 from blueyed/encodedfile-write-typerror
nicoddemus Mar 1, 2019
75e1fde
tox.ini: add config for isort
blueyed Mar 1, 2019
0d31e85
Run isort
blueyed Mar 1, 2019
f0d7773
tox: split default posargs in multiple env vars
blueyed Feb 27, 2019
f8160f7
ci: Travis: run py37-lsof-numpy-xdist with coverage
blueyed Mar 1, 2019
a96907a
.coveragerc: use globs with includes
blueyed Mar 1, 2019
90031ed
Merge pull request #4847 from blueyed/tox-posargs-lsof
blueyed Mar 1, 2019
4290cac
Merge pull request #4864 from blueyed/isort-cfg
blueyed Mar 1, 2019
dac164c
Add missing ref docs to tmp_path and tmp_path_factory
nicoddemus Mar 1, 2019
907e949
Merge pull request #4869 from nicoddemus/tmppath-docs
nicoddemus Mar 1, 2019
ed68fcf
Merge pull request #4867 from blueyed/fix-cov
blueyed Mar 1, 2019
2970c1d
tox: generic pluggymaster factor
blueyed Mar 3, 2019
c4aa57b
tox/setup.py: remove _PYTEST_SETUP_SKIP_PLUGGY_DEP=1 hack
blueyed Mar 3, 2019
f3f6cb2
Merge pull request #4877 from blueyed/pluggymaster
nicoddemus Mar 3, 2019
83558a0
tests: make test_crash_on_closing_tmpfile_py27 more reliable
blueyed Mar 3, 2019
54c70bc
Merge pull request #4878 from blueyed/fix-test_crash_on_closing_tmpfi…
blueyed Mar 4, 2019
c6eb341
.coveragerc: fix include for pypy
blueyed Mar 4, 2019
fa94e3c
ci: Azure: fix coverage generation with PyPy
blueyed Mar 1, 2019
2e871f3
ci: Azure: clarify name for coverage job
blueyed Mar 4, 2019
ddb16a1
Merge pull request #4874 from blueyed/pypy3-azure
blueyed Mar 4, 2019
07fa693
ci: Azure: remove pypy3
blueyed Mar 4, 2019
2fe9226
Merge pull request #4883 from blueyed/fix-coverage-includes
blueyed Mar 4, 2019
bd2c9be
Merge pull request #4885 from blueyed/fix-master
blueyed Mar 4, 2019
8481e43
ci: revisit coverage reporting
blueyed Mar 1, 2019
2b3d69d
Merge pull request #4865 from blueyed/revisit-cov-new
blueyed Mar 5, 2019
7668703
Merge branch 'master' into merge-master-into-features
blueyed Mar 5, 2019
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
15 changes: 12 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
[run]
source = pytest,_pytest,testing/
include =
*/src/*
testing/*
*/lib/python*/site-packages/_pytest/*
*/lib/python*/site-packages/pytest.py
*/pypy*/site-packages/_pytest/*
*/pypy*/site-packages/pytest.py
*\Lib\site-packages\_pytest\*
*\Lib\site-packages\pytest.py
parallel = 1
branch = 1

[paths]
source = src/
.tox/*/lib/python*/site-packages/
.tox\*\Lib\site-packages\
*/lib/python*/site-packages/
*/pypy*/site-packages/
*\Lib\site-packages\
121 changes: 74 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,69 +9,86 @@ stages:
python:
- '3.7'
install:
- pip install --upgrade --pre tox
env:
matrix:
- TOXENV=py27
# Specialized factors for py27.
- TOXENV=py27-nobyte
- TOXENV=py27-xdist
- TOXENV=py27-pluggymaster
# Specialized factors for py37.
- TOXENV=py37-pexpect,py37-trial,py37-numpy
- TOXENV=py37-pluggymaster
- TOXENV=py37-freeze PYTEST_NO_COVERAGE=1

matrix:
allow_failures:
- python: '3.8-dev'
env: TOXENV=py38-xdist
- python -m pip install --upgrade --pre tox

jobs:
include:
# OSX tests - first (in test stage), since they are the slower ones.
- &test-macos
# NOTE: (tests with) pexpect appear to be buggy on Travis,
# at least with coverage.
# Log: https://travis-ci.org/pytest-dev/pytest/jobs/500358864
os: osx
osx_image: xcode10.1
language: generic
# Coverage for:
# - py2 with symlink in test_cmdline_python_package_symlink.
env: TOXENV=py27-xdist PYTEST_COVERAGE=1
before_install:
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
- <<: *test-macos
env: TOXENV=py37-xdist
before_install:
- which python3
- python3 -V
- ln -sfn "$(which python3)" /usr/local/bin/python
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37

# Full run of latest (major) supported versions, without xdist.
- env: TOXENV=py27
python: '2.7'
- env: TOXENV=py37
python: '3.7'

# Coverage tracking is slow with pypy, skip it.
- env: TOXENV=pypy-xdist PYTEST_NO_COVERAGE=1
- env: TOXENV=pypy-xdist
python: 'pypy2.7-6.0'
- env: TOXENV=pypy3-xdist PYTEST_NO_COVERAGE=1
- env: TOXENV=pypy3-xdist
python: 'pypy3.5-6.0'

- env: TOXENV=py34-xdist
python: '3.4'
- env: TOXENV=py35-xdist
python: '3.5'
- env: TOXENV=py36-xdist
python: '3.6'
- env: TOXENV=py37
- &test-macos
language: generic
os: osx
osx_image: xcode9.4
sudo: required
install:
- python -m pip install --pre tox
env: TOXENV=py27-xdist
- <<: *test-macos
env: TOXENV=py37-xdist
before_install:
- brew update
- brew upgrade python
- brew unlink python
- brew link python

# Coverage for:
# - pytester's LsofFdLeakChecker
# - TestArgComplete (linux only)
# - numpy
- env: TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1

# Specialized factors for py27.
- env: TOXENV=py27-nobyte-numpy-xdist
python: '2.7'
- env: TOXENV=py27-pluggymaster-xdist
python: '2.7'

# Specialized factors for py37.
# Coverage for:
# - test_sys_breakpoint_interception (via pexpect).
- env: TOXENV=py37-pexpect,py37-trial PYTEST_COVERAGE=1
- env: TOXENV=py37-pluggymaster-xdist
- env: TOXENV=py37-freeze

# Jobs only run via Travis cron jobs (currently daily).
- env: TOXENV=py38-xdist
python: '3.8-dev'
if: type = cron

- stage: baseline
env: TOXENV=py27-pexpect,py27-trial,py27-numpy
- env: TOXENV=py37-xdist
- env: TOXENV=linting,docs,doctesting
python: '3.7'
# Coverage for:
# - _pytest.unittest._handle_skip (via pexpect).
env: TOXENV=py27-pexpect,py27-trial PYTEST_COVERAGE=1
python: '2.7'
# Use py36 here for faster baseline.
- env: TOXENV=py36-xdist
python: '3.6'
- env: TOXENV=linting,docs,doctesting PYTEST_COVERAGE=1

- stage: deploy
python: '3.6'
env: PYTEST_NO_COVERAGE=1
install: pip install -U setuptools setuptools_scm
script: skip
deploy:
Expand All @@ -85,9 +102,19 @@ jobs:
tags: true
repo: pytest-dev/pytest

matrix:
allow_failures:
- python: '3.8-dev'
env: TOXENV=py38-xdist

before_script:
- |
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
# Do not (re-)upload coverage with cron runs.
if [[ "$TRAVIS_EVENT_TYPE" = cron ]]; then
PYTEST_COVERAGE=0
fi
- |
if [[ "$PYTEST_COVERAGE" = 1 ]]; then
export COVERAGE_FILE="$PWD/.coverage"
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
Expand All @@ -98,14 +125,14 @@ script: tox --recreate

after_success:
- |
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
if [[ "$PYTEST_COVERAGE" = 1 ]]; then
set -e
# Add last TOXENV to $PATH.
PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH"
coverage combine
coverage xml --ignore-errors
coverage report -m --ignore-errors
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F $TRAVIS_OS_NAME
coverage xml
coverage report -m
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV-$TRAVIS_OS_NAME
fi

notifications:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master
:target: https://travis-ci.org/pytest-dev/pytest

.. image:: https://ci.appveyor.com/api/projects/status/mrgbjaua7t33pg6b?svg=true
:target: https://ci.appveyor.com/project/pytestbot/pytest
.. image:: https://dev.azure.com/pytest-dev/pytest/_apis/build/status/pytest-CI?branchName=master
:target: https://dev.azure.com/pytest-dev/pytest

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
Expand Down
48 changes: 0 additions & 48 deletions appveyor.yml

This file was deleted.

72 changes: 53 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ variables:
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml"
python.needs_vc: False
python.exe: "python"
COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
PYTEST_COVERAGE: '0'

jobs:

Expand All @@ -17,47 +20,68 @@ jobs:
py27:
python.version: '2.7'
tox.env: 'py27'
py27-xdist:
py27-nobyte-lsof-numpy:
python.version: '2.7'
tox.env: 'py27-xdist'
py27-numpy/nobyte:
python.version: '2.7'
tox.env: 'py27-numpy,py27-nobyte'
tox.env: 'py27-lsof-nobyte-numpy'
# Coverage for:
# - test_supports_breakpoint_module_global
# - test_terminal_reporter_writer_attr (without xdist)
# - "if write" branch in _pytest.assertion.rewrite
# - numpy
# - pytester's LsofFdLeakChecker (being skipped)
PYTEST_COVERAGE: '1'
py27-trial:
python.version: '2.7'
tox.env: 'py27-trial'
python.needs_vc: True
py27-pluggymaster:
py27-pluggymaster-xdist:
python.version: '2.7'
tox.env: 'pluggymaster'
tox.env: 'py27-pluggymaster-xdist'
# Coverage for:
# - except-IOError in _attempt_to_close_capture_file for py2.
# Also seen with py27-nobyte (using xdist), and py27-xdist.
# But no exception with py27-pexpect,py27-trial,py27-numpy.
PYTEST_COVERAGE: '1'
pypy:
python.version: 'pypy'
tox.env: 'pypy'
python.exe: 'pypy'
py34:
# NOTE: pypy3 fails to install pip currently due to an interal error.
# pypy3:
# python.version: 'pypy3'
# tox.env: 'pypy3'
# python.exe: 'pypy3'
py34-xdist:
python.version: '3.4'
tox.env: 'py34'
py35:
tox.env: 'py34-xdist'
# Coverage for:
# - _pytest.compat._bytes_to_ascii
PYTEST_COVERAGE: '1'
py35-xdist:
python.version: '3.5'
tox.env: 'py35'
py36:
tox.env: 'py35-xdist'
# Coverage for:
# - test_supports_breakpoint_module_global
PYTEST_COVERAGE: '1'
py36-xdist:
python.version: '3.6'
tox.env: 'py36'
tox.env: 'py36-xdist'
py37:
python.version: '3.7'
tox.env: 'py37'
# Coverage for:
# - _py36_windowsconsoleio_workaround (with py36+)
# - test_request_garbage (no xdist)
PYTEST_COVERAGE: '1'
py37-linting/docs/doctesting:
python.version: '3.7'
tox.env: 'linting,docs,doctesting'
py37-xdist:
python.version: '3.7'
tox.env: 'py37-xdist'
py37-trial/numpy:
python.version: '3.7'
tox.env: 'py37-trial,py37-numpy'
py37-pluggymaster:
py37-pluggymaster-xdist:
python.version: '3.7'
tox.env: 'py37-pluggymaster'
tox.env: 'py37-pluggymaster-xdist'
maxParallel: 10

steps:
Expand Down Expand Up @@ -91,11 +115,21 @@ jobs:
- script: $(python.exe) -m pip install --upgrade pip && $(python.exe) -m pip install tox
displayName: 'Install tox'

- script: $(python.exe) -m tox -e $(tox.env)
- script: |
call scripts/setup-coverage-vars.bat || goto :eof
$(python.exe) -m tox -e $(tox.env)
displayName: 'Run tests'

- task: PublishTestResults@2
inputs:
testResultsFiles: 'build/test-results/$(tox.env).xml'
testRunTitle: '$(tox.env)'
condition: succeededOrFailed()

- script: call scripts\upload-coverage.bat
displayName: 'Report and upload coverage'
condition: eq(variables['PYTEST_COVERAGE'], '1')
env:
PYTHON: $(python.exe)
CODECOV_TOKEN: $(CODECOV_TOKEN)
PYTEST_CODECOV_NAME: $(tox.env)
1 change: 0 additions & 1 deletion bench/skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest


SKIP = True


Expand Down
1 change: 1 addition & 0 deletions changelog/4861.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve validation of contents written to captured output so it behaves the same as when capture is disabled.
Loading