Skip to content

Commit 4f57d40

Browse files
authored
Merge master into features (#5374)
Merge master into features
2 parents 693c3b7 + 5976f36 commit 4f57d40

File tree

231 files changed

+1353
-2924
lines changed

Some content is hidden

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

231 files changed

+1353
-2924
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ repos:
77
args: [--safe, --quiet]
88
language_version: python3
99
- repo: https://github.com/asottile/blacken-docs
10-
rev: v0.5.0
10+
rev: v1.0.0
1111
hooks:
1212
- id: blacken-docs
1313
additional_dependencies: [black==19.3b0]
1414
language_version: python3
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v2.2.2
16+
rev: v2.2.3
1717
hooks:
1818
- id: trailing-whitespace
1919
- id: end-of-file-fixer
2020
- id: fix-encoding-pragma
21+
args: [--remove]
2122
- id: check-yaml
2223
- id: debug-statements
2324
exclude: _pytest/debugging.py
@@ -31,14 +32,14 @@ repos:
3132
rev: v1.4.0
3233
hooks:
3334
- id: reorder-python-imports
34-
args: ['--application-directories=.:src']
35+
args: ['--application-directories=.:src', --py3-plus]
3536
- repo: https://github.com/asottile/pyupgrade
36-
rev: v1.15.0
37+
rev: v1.18.0
3738
hooks:
3839
- id: pyupgrade
39-
args: [--keep-percent-format]
40+
args: [--py3-plus]
4041
- repo: https://github.com/pre-commit/pygrep-hooks
41-
rev: v1.3.0
42+
rev: v1.4.0
4243
hooks:
4344
- id: rst-backticks
4445
- repo: local

.travis.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,28 @@ install:
1919
jobs:
2020
include:
2121
# OSX tests - first (in test stage), since they are the slower ones.
22-
- &test-macos
23-
os: osx
22+
- os: osx
23+
# NOTE: (tests with) pexpect appear to be buggy on Travis,
24+
# at least with coverage.
25+
# Log: https://travis-ci.org/pytest-dev/pytest/jobs/500358864
2426
osx_image: xcode10.1
2527
language: generic
26-
# Coverage for:
27-
# - py2 with symlink in test_cmdline_python_package_symlink.
28-
env: TOXENV=py27-xdist PYTEST_COVERAGE=1
29-
before_install:
30-
- python -V
31-
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
32-
- <<: *test-macos
33-
env: TOXENV=py37-pexpect,py37-xdist PYTEST_COVERAGE=1
28+
env: TOXENV=py37-xdist PYTEST_COVERAGE=1
3429
before_install:
3530
- which python3
3631
- python3 -V
3732
- ln -sfn "$(which python3)" /usr/local/bin/python
3833
- python -V
3934
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37
4035

41-
# Full run of latest (major) supported versions, without xdist.
42-
- env: TOXENV=py27
43-
python: '2.7'
44-
- env: TOXENV=py37
36+
# Full run of latest supported version, without xdist.
37+
- env: TOXENV=py37 PYTEST_COVERAGE=1
4538
python: '3.7'
4639

4740
# Coverage tracking is slow with pypy, skip it.
48-
- env: TOXENV=pypy-xdist
49-
python: 'pypy'
5041
- env: TOXENV=pypy3-xdist
5142
python: 'pypy3'
5243

53-
- env: TOXENV=py34-xdist
54-
python: '3.4'
5544
- env: TOXENV=py35-xdist
5645
python: '3.5'
5746

@@ -62,12 +51,6 @@ jobs:
6251
# Empty PYTEST_ADDOPTS to run this non-verbose.
6352
- env: TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1 PYTEST_ADDOPTS=
6453

65-
# Specialized factors for py27.
66-
- env: TOXENV=py27-nobyte-numpy-xdist
67-
python: '2.7'
68-
- env: TOXENV=py27-pluggymaster-xdist
69-
python: '2.7'
70-
7154
# Specialized factors for py37.
7255
# Coverage for:
7356
# - test_sys_breakpoint_interception (via pexpect).
@@ -81,12 +64,7 @@ jobs:
8164
if: type = cron
8265

8366
- stage: baseline
84-
# Coverage for:
85-
# - _pytest.unittest._handle_skip (via pexpect).
86-
env: TOXENV=py27-pexpect,py27-twisted PYTEST_COVERAGE=1
87-
python: '2.7'
88-
# Use py36 here for faster baseline.
89-
- env: TOXENV=py36-xdist
67+
env: TOXENV=py36-xdist
9068
python: '3.6'
9169
- env: TOXENV=linting,docs,doctesting PYTEST_COVERAGE=1
9270
cache:
@@ -112,9 +90,6 @@ matrix:
11290
allow_failures:
11391
- python: '3.8-dev'
11492
env: TOXENV=py38-xdist
115-
# Temporary (https://github.com/pytest-dev/pytest/pull/5334).
116-
- env: TOXENV=pypy3-xdist
117-
python: 'pypy3'
11893

11994
before_script:
12095
- |

CHANGELOG.rst

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,96 @@ with advance notice in the **Deprecations** section of releases.
1818
1919
.. towncrier release notes start
2020
21+
pytest 4.6.1 (2019-06-02)
22+
=========================
23+
24+
Bug Fixes
25+
---------
26+
27+
- `#5354 <https://github.com/pytest-dev/pytest/issues/5354>`_: Fix ``pytest.mark.parametrize`` when the argvalues is an iterator.
28+
29+
30+
- `#5358 <https://github.com/pytest-dev/pytest/issues/5358>`_: Fix assertion rewriting of ``all()`` calls to deal with non-generators.
31+
32+
33+
pytest 4.6.0 (2019-05-31)
34+
=========================
35+
36+
Important
37+
---------
38+
39+
The ``4.6.X`` series will be the last series to support **Python 2 and Python 3.4**.
40+
41+
For more details, see our `Python 2.7 and 3.4 support plan <https://docs.pytest.org/en/latest/py27-py34-deprecation.html>`__.
42+
43+
44+
Features
45+
--------
46+
47+
- `#4559 <https://github.com/pytest-dev/pytest/issues/4559>`_: Added the ``junit_log_passing_tests`` ini value which can be used to enable or disable logging of passing test output in the Junit XML file.
48+
49+
50+
- `#4956 <https://github.com/pytest-dev/pytest/issues/4956>`_: pytester's ``testdir.spawn`` uses ``tmpdir`` as HOME/USERPROFILE directory.
51+
52+
53+
- `#5062 <https://github.com/pytest-dev/pytest/issues/5062>`_: Unroll calls to ``all`` to full for-loops with assertion rewriting for better failure messages, especially when using Generator Expressions.
54+
55+
56+
- `#5063 <https://github.com/pytest-dev/pytest/issues/5063>`_: Switch from ``pkg_resources`` to ``importlib-metadata`` for entrypoint detection for improved performance and import time.
57+
58+
59+
- `#5091 <https://github.com/pytest-dev/pytest/issues/5091>`_: The output for ini options in ``--help`` has been improved.
60+
61+
62+
- `#5269 <https://github.com/pytest-dev/pytest/issues/5269>`_: ``pytest.importorskip`` includes the ``ImportError`` now in the default ``reason``.
63+
64+
65+
- `#5311 <https://github.com/pytest-dev/pytest/issues/5311>`_: Captured logs that are output for each failing test are formatted using the
66+
ColoredLevelFormatter.
67+
68+
69+
- `#5312 <https://github.com/pytest-dev/pytest/issues/5312>`_: Improved formatting of multiline log messages in Python 3.
70+
71+
72+
73+
Bug Fixes
74+
---------
75+
76+
- `#2064 <https://github.com/pytest-dev/pytest/issues/2064>`_: The debugging plugin imports the wrapped ``Pdb`` class (``--pdbcls``) on-demand now.
77+
78+
79+
- `#4908 <https://github.com/pytest-dev/pytest/issues/4908>`_: The ``pytest_enter_pdb`` hook gets called with post-mortem (``--pdb``).
80+
81+
82+
- `#5036 <https://github.com/pytest-dev/pytest/issues/5036>`_: Fix issue where fixtures dependent on other parametrized fixtures would be erroneously parametrized.
83+
84+
85+
- `#5256 <https://github.com/pytest-dev/pytest/issues/5256>`_: Handle internal error due to a lone surrogate unicode character not being representable in Jython.
86+
87+
88+
- `#5257 <https://github.com/pytest-dev/pytest/issues/5257>`_: Ensure that ``sys.stdout.mode`` does not include ``'b'`` as it is a text stream.
89+
90+
91+
- `#5278 <https://github.com/pytest-dev/pytest/issues/5278>`_: Pytest's internal python plugin can be disabled using ``-p no:python`` again.
92+
93+
94+
- `#5286 <https://github.com/pytest-dev/pytest/issues/5286>`_: Fix issue with ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option not working when using a list of test IDs in parametrized tests.
95+
96+
97+
- `#5330 <https://github.com/pytest-dev/pytest/issues/5330>`_: Show the test module being collected when emitting ``PytestCollectionWarning`` messages for
98+
test classes with ``__init__`` and ``__new__`` methods to make it easier to pin down the problem.
99+
100+
101+
- `#5333 <https://github.com/pytest-dev/pytest/issues/5333>`_: Fix regression in 4.5.0 with ``--lf`` not re-running all tests with known failures from non-selected tests.
102+
103+
104+
105+
Improved Documentation
106+
----------------------
107+
108+
- `#5250 <https://github.com/pytest-dev/pytest/issues/5250>`_: Expand docs on use of ``setenv`` and ``delenv`` with ``monkeypatch``.
109+
110+
21111
pytest 4.5.0 (2019-05-11)
22112
=========================
23113

HOWTORELEASE.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ taking a lot of time to make a new one.
1212

1313
#. Create a branch ``release-X.Y.Z`` with the version for the release.
1414

15+
* **maintenance releases**: from ``4.6-maintenance``;
16+
1517
* **patch releases**: from the latest ``master``;
1618

1719
* **minor releases**: from the latest ``features``; then merge with the latest ``master``;
@@ -24,7 +26,8 @@ taking a lot of time to make a new one.
2426

2527
This will generate a commit with all the changes ready for pushing.
2628

27-
#. Open a PR for this branch targeting ``master``.
29+
#. Open a PR for this branch targeting ``master`` (or ``4.6-maintenance`` for
30+
maintenance releases).
2831

2932
#. After all tests pass and the PR has been approved, publish to PyPI by pushing the tag::
3033

@@ -33,7 +36,16 @@ taking a lot of time to make a new one.
3336

3437
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
3538

36-
#. Merge the PR into ``master``.
39+
#. Merge the PR.
40+
41+
#. If this is a maintenance release, cherry-pick the CHANGELOG / announce
42+
files to the ``master`` branch::
43+
44+
git fetch --all --prune
45+
git checkout origin/master -b cherry-pick-maintenance-release
46+
git cherry-pick --no-commit -m1 origin/4.6-maintenance
47+
git checkout origin/master -- changelog
48+
git commit # no arguments
3749

3850
#. Send an email announcement with the contents from::
3951

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Features
8585
- Can run `unittest <https://docs.pytest.org/en/latest/unittest.html>`_ (or trial),
8686
`nose <https://docs.pytest.org/en/latest/nose.html>`_ test suites out of the box;
8787

88-
- Python 2.7, Python 3.4+, PyPy 2.3, Jython 2.5 (untested);
88+
- Python 3.5+ and PyPy3;
8989

9090
- Rich plugin architecture, with over 315+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community;
9191

azure-pipelines.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ trigger:
44

55
variables:
66
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml -vv"
7-
python.needs_vc: False
87
COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
98
COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
109
PYTEST_COVERAGE: '0'
@@ -16,44 +15,10 @@ jobs:
1615
vmImage: "vs2017-win2016"
1716
strategy:
1817
matrix:
19-
py27:
20-
python.version: '2.7'
21-
tox.env: 'py27'
22-
py27-nobyte-lsof-numpy:
23-
python.version: '2.7'
24-
tox.env: 'py27-lsof-nobyte-numpy'
25-
# Coverage for:
26-
# - test_supports_breakpoint_module_global
27-
# - test_terminal_reporter_writer_attr (without xdist)
28-
# - "if write" branch in _pytest.assertion.rewrite
29-
# - numpy
30-
# - pytester's LsofFdLeakChecker (being skipped)
31-
PYTEST_COVERAGE: '1'
32-
py27-twisted:
33-
python.version: '2.7'
34-
tox.env: 'py27-twisted'
35-
python.needs_vc: True
36-
py27-pluggymaster-xdist:
37-
python.version: '2.7'
38-
tox.env: 'py27-pluggymaster-xdist'
39-
# Coverage for:
40-
# - except-IOError in _attempt_to_close_capture_file for py2.
41-
# Also seen with py27-nobyte (using xdist), and py27-xdist.
42-
# But no exception with py27-pexpect,py27-twisted,py27-numpy.
43-
PYTEST_COVERAGE: '1'
44-
# -- pypy2 and pypy3 are disabled for now: #5279 --
45-
# pypy:
46-
# python.version: 'pypy2'
47-
# tox.env: 'pypy'
18+
# -- pypy3 disabled for now: #5279 --
4819
# pypy3:
4920
# python.version: 'pypy3'
5021
# tox.env: 'pypy3'
51-
py34-xdist:
52-
python.version: '3.4'
53-
tox.env: 'py34-xdist'
54-
# Coverage for:
55-
# - _pytest.compat._bytes_to_ascii
56-
PYTEST_COVERAGE: '1'
5722
py35-xdist:
5823
python.version: '3.5'
5924
tox.env: 'py35-xdist'
@@ -87,10 +52,6 @@ jobs:
8752
versionSpec: '$(python.version)'
8853
architecture: 'x64'
8954

90-
- script: choco install vcpython27
91-
condition: eq(variables['python.needs_vc'], True)
92-
displayName: 'Install VC for py27'
93-
9455
- script: python -m pip install --upgrade pip && python -m pip install tox
9556
displayName: 'Install tox'
9657

bench/bench.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
import sys
32

43
if __name__ == "__main__":

bench/bench_argcomplete.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# 10000 iterations, just for relative comparison
32
# 2.7.5 3.3.2
43
# FilesCompleter 75.1109 69.2116

bench/empty.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
# -*- coding: utf-8 -*-
21
for i in range(1000):
32
exec("def test_func_%d(): pass" % i)

bench/manyparam.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
import pytest
32

43

bench/skip.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from six.moves import range
3-
41
import pytest
52

63
SKIP = True

changelog/2064.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/4559.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/4908.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/4956.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5036.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5062.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5063.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5091.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5250.doc.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5256.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5257.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5269.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5278.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5286.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5311.feature.rst

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

changelog/5312.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5330.bugfix.rst

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

changelog/5333.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5335.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Colorize level names when the level in the logging format is formatted using
2+
'%(levelname).Xs' (truncated fixed width alignment), where X is an integer.

0 commit comments

Comments
 (0)