Skip to content

Commit c03f60e

Browse files
author
Victor
committed
Merge branch 'master' of https://github.com/pytest-dev/pytest into features-assertion-pass-hook
# Conflicts: # setup.py # src/_pytest/assertion/rewrite.py # src/_pytest/hookspec.py # testing/test_assertrewrite.py
2 parents e37c58c + 2c90b3d commit c03f60e

File tree

335 files changed

+21665
-14050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+21665
-14050
lines changed

.coveragerc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[run]
2-
omit =
3-
# standlonetemplate is read dynamically and tested by test_genscript
4-
*standalonetemplate.py
2+
source = _pytest,testing
3+
parallel = 1
4+
branch = 1

.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

.github/labels.toml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
["os: cygwin"]
2+
color = "006b75"
3+
description = "cygwin platform-specific problem"
4+
name = "os: cygwin"
5+
6+
["os: linux"]
7+
color = "1d76db"
8+
description = "linux platform-specific problem"
9+
name = "os: linux"
10+
11+
["os: mac"]
12+
color = "bfdadc"
13+
description = "mac platform-specific problem"
14+
name = "os: mac"
15+
16+
["os: windows"]
17+
color = "fbca04"
18+
description = "windows platform-specific problem"
19+
name = "os: windows"
20+
21+
["plugin: argcomplete"]
22+
color = "d4c5f9"
23+
description = "related to the argcomplete builtin plugin"
24+
name = "plugin: argcomplete"
25+
26+
["plugin: cache"]
27+
color = "c7def8"
28+
description = "related to the cache builtin plugin"
29+
name = "plugin: cache"
30+
31+
["plugin: capture"]
32+
color = "1d76db"
33+
description = "related to the capture builtin plugin"
34+
name = "plugin: capture"
35+
36+
["plugin: debugging"]
37+
color = "dd52a8"
38+
description = "related to the debugging builtin plugin"
39+
name = "plugin: debugging"
40+
41+
["plugin: doctests"]
42+
color = "fad8c7"
43+
description = "related to the doctests builtin plugin"
44+
name = "plugin: doctests"
45+
46+
["plugin: junitxml"]
47+
color = "c5def5"
48+
description = "related to the junitxml builtin plugin"
49+
name = "plugin: junitxml"
50+
51+
["plugin: logging"]
52+
color = "ff5432"
53+
description = "related to the logging builtin plugin"
54+
name = "plugin: logging"
55+
56+
["plugin: monkeypatch"]
57+
color = "0e8a16"
58+
description = "related to the monkeypatch builtin plugin"
59+
name = "plugin: monkeypatch"
60+
61+
["plugin: nose"]
62+
color = "bfdadc"
63+
description = "related to the nose integration builtin plugin"
64+
name = "plugin: nose"
65+
66+
["plugin: pastebin"]
67+
color = "bfd4f2"
68+
description = "related to the pastebin builtin plugin"
69+
name = "plugin: pastebin"
70+
71+
["plugin: pytester"]
72+
color = "c5def5"
73+
description = "related to the pytester builtin plugin"
74+
name = "plugin: pytester"
75+
76+
["plugin: tmpdir"]
77+
color = "bfd4f2"
78+
description = "related to the tmpdir builtin plugin"
79+
name = "plugin: tmpdir"
80+
81+
["plugin: unittest"]
82+
color = "006b75"
83+
description = "related to the unittest integration builtin plugin"
84+
name = "plugin: unittest"
85+
86+
["plugin: warnings"]
87+
color = "fef2c0"
88+
description = "related to the warnings builtin plugin"
89+
name = "plugin: warnings"
90+
91+
["plugin: xdist"]
92+
color = "5319e7"
93+
description = "related to the xdist external plugin"
94+
name = "plugin: xdist"
95+
96+
["status: critical"]
97+
color = "e11d21"
98+
description = "grave problem or usability issue that affects lots of users"
99+
name = "status: critical"
100+
101+
["status: easy"]
102+
color = "bfe5bf"
103+
description = "easy issue that is friendly to new contributor"
104+
name = "status: easy"
105+
106+
["status: help wanted"]
107+
color = "159818"
108+
description = "developers would like help from experts on this topic"
109+
name = "status: help wanted"
110+
111+
["status: needs information"]
112+
color = "5319e7"
113+
description = "reporter needs to provide more information; can be closed after 2 or more weeks of inactivity"
114+
name = "status: needs information"
115+
116+
["topic: collection"]
117+
color = "006b75"
118+
description = "related to the collection phase"
119+
name = "topic: collection"
120+
121+
["topic: config"]
122+
color = "006b75"
123+
description = "related to config handling, argument parsing and config file"
124+
name = "topic: config"
125+
126+
["topic: fixtures"]
127+
color = "5319e7"
128+
description = "anything involving fixtures directly or indirectly"
129+
name = "topic: fixtures"
130+
131+
["topic: marks"]
132+
color = "b60205"
133+
description = "related to marks, either the general marks or builtin"
134+
name = "topic: marks"
135+
136+
["topic: parametrize"]
137+
color = "fbca04"
138+
description = "related to @pytest.mark.parametrize"
139+
name = "topic: parametrize"
140+
141+
["topic: reporting"]
142+
color = "fef2c0"
143+
description = "related to terminal output and user-facing messages and errors"
144+
name = "topic: reporting"
145+
146+
["topic: rewrite"]
147+
color = "0e8a16"
148+
description = "related to the assertion rewrite mechanism"
149+
name = "topic: rewrite"

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include/
1919
.hypothesis/
2020

2121
# autogenerated
22-
_pytest/_version.py
22+
src/_pytest/_version.py
2323
# setuptools
2424
.eggs/
2525

@@ -35,6 +35,11 @@ env/
3535
.cache
3636
.pytest_cache
3737
.coverage
38+
.coverage.*
39+
coverage.xml
3840
.ropeproject
3941
.idea
4042
.hypothesis
43+
.pydevproject
44+
.project
45+
.settings

.pre-commit-config.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
exclude: doc/en/example/py2py3/test_py2.py
2+
repos:
3+
- repo: https://github.com/ambv/black
4+
rev: 18.6b4
5+
hooks:
6+
- id: black
7+
args: [--safe, --quiet]
8+
language_version: python3
9+
- repo: https://github.com/asottile/blacken-docs
10+
rev: v0.2.0
11+
hooks:
12+
- id: blacken-docs
13+
additional_dependencies: [black==18.6b4]
14+
language_version: python3
15+
- repo: https://github.com/pre-commit/pre-commit-hooks
16+
rev: v1.3.0
17+
hooks:
18+
- id: trailing-whitespace
19+
- id: end-of-file-fixer
20+
- id: check-yaml
21+
- id: debug-statements
22+
exclude: _pytest/debugging.py
23+
- id: flake8
24+
- repo: https://github.com/asottile/pyupgrade
25+
rev: v1.2.0
26+
hooks:
27+
- id: pyupgrade
28+
- repo: https://github.com/pre-commit/pygrep-hooks
29+
rev: v1.0.0
30+
hooks:
31+
- id: rst-backticks
32+
- repo: local
33+
hooks:
34+
- id: rst
35+
name: rst
36+
entry: rst-lint --encoding utf-8
37+
files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|changelog/.*)$
38+
language: python
39+
additional_dependencies: [pygments, restructuredtext_lint]
40+
- id: changelogs-rst
41+
name: changelog filenames
42+
language: fail
43+
entry: 'changelog files must be named ####.(feature|bugfix|doc|removal|vendor|trivial).rst'
44+
exclude: changelog/(\d+\.(feature|bugfix|doc|removal|vendor|trivial).rst|README.rst|_template.rst)
45+
files: ^changelog/

.travis.yml

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
sudo: false
22
language: python
3+
stages:
4+
- baseline
5+
- name: test
6+
if: repo = pytest-dev/pytest AND tag IS NOT present
7+
- name: deploy
8+
if: repo = pytest-dev/pytest AND tag IS present
39
python:
410
- '3.6'
511
install:
612
- pip install --upgrade --pre tox
713
env:
814
matrix:
9-
# coveralls is not listed in tox's envlist, but should run in travis
10-
- TOXENV=coveralls
1115
# note: please use "tox --listenvs" to populate the build matrix below
12-
- TOXENV=linting
13-
- TOXENV=py27
14-
- TOXENV=py34
15-
- TOXENV=py36
16+
# please remove the linting env in all cases
1617
- TOXENV=py27-pexpect
1718
- TOXENV=py27-xdist
1819
- TOXENV=py27-trial
@@ -25,22 +26,46 @@ env:
2526
- TOXENV=py36-pluggymaster
2627
- TOXENV=py27-nobyte
2728
- TOXENV=doctesting
28-
- TOXENV=docs
29+
- TOXENV=docs PYTEST_NO_COVERAGE=1
2930

3031
jobs:
3132
include:
32-
- env: TOXENV=pypy
33+
# Coverage tracking is slow with pypy, skip it.
34+
- env: TOXENV=pypy PYTEST_NO_COVERAGE=1
3335
python: 'pypy-5.4'
3436
- env: TOXENV=py35
3537
python: '3.5'
36-
- env: TOXENV=py35-freeze
37-
python: '3.5'
38+
- env: TOXENV=py36-freeze PYTEST_NO_COVERAGE=1
39+
python: '3.6'
3840
- env: TOXENV=py37
39-
python: 'nightly'
41+
python: '3.7'
42+
sudo: required
43+
dist: xenial
44+
- &test-macos
45+
language: generic
46+
os: osx
47+
osx_image: xcode9.4
48+
sudo: required
49+
install:
50+
- python -m pip install --pre tox
51+
env: TOXENV=py27
52+
- <<: *test-macos
53+
env: TOXENV=py37
54+
before_install:
55+
- brew update
56+
- brew upgrade python
57+
- brew unlink python
58+
- brew link python
59+
60+
- stage: baseline
61+
env: TOXENV=py27
62+
- env: TOXENV=py34
63+
- env: TOXENV=py36
64+
- env: TOXENV=linting PYTEST_NO_COVERAGE=1
4065

4166
- stage: deploy
4267
python: '3.6'
43-
env:
68+
env: PYTEST_NO_COVERAGE=1
4469
install: pip install -U setuptools setuptools_scm
4570
script: skip
4671
deploy:
@@ -54,8 +79,34 @@ jobs:
5479
tags: true
5580
repo: pytest-dev/pytest
5681

82+
before_script:
83+
- |
84+
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
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"
88+
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
89+
fi
90+
5791
script: tox --recreate
5892

93+
after_success:
94+
- |
95+
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
96+
set -e
97+
pip install codecov
98+
coverage combine
99+
coverage xml --ignore-errors
100+
coverage report -m --ignore-errors
101+
codecov --required -X gcov pycov search -f coverage.xml --flags ${TOXENV//-/ } linux
102+
103+
# Coveralls does not support merged reports.
104+
if [[ "$TOXENV" = py37 ]]; then
105+
pip install coveralls
106+
coveralls
107+
fi
108+
fi
109+
59110
notifications:
60111
irc:
61112
channels:
@@ -65,3 +116,7 @@ notifications:
65116
skip_join: true
66117
email:
67118
119+
cache:
120+
directories:
121+
- $HOME/.cache/pip
122+
- $HOME/.cache/pre-commit

0 commit comments

Comments
 (0)