Skip to content

Commit b5b710b

Browse files
committed
Merge master into features
Several conflicts, mostly due to 2c402f4. Conflicts: .pre-commit-config.yaml src/_pytest/outcomes.py src/_pytest/python_api.py tox.ini
2 parents 4abf95b + 0d3958e commit b5b710b

Some content is hidden

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

66 files changed

+620
-229
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ repos:
55
hooks:
66
- id: black
77
args: [--safe, --quiet]
8-
language_version: python3
98
- repo: https://github.com/asottile/blacken-docs
109
rev: v1.0.0
1110
hooks:
1211
- id: blacken-docs
1312
additional_dependencies: [black==19.3b0]
14-
language_version: python3
1513
- repo: https://github.com/pre-commit/pre-commit-hooks
1614
rev: v2.2.3
1715
hooks:

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ env:
1313
global:
1414
- PYTEST_ADDOPTS=-vv
1515

16+
# setuptools-scm needs all tags in order to obtain a proper version
17+
git:
18+
depth: false
19+
1620
install:
1721
- python -m pip install --upgrade --pre tox
1822

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ Tareq Alayan
239239
Ted Xiao
240240
Thomas Grainger
241241
Thomas Hisch
242+
Tim Hoffmann
242243
Tim Strazny
243244
Tom Dalton
244245
Tom Viner
@@ -258,6 +259,7 @@ Wil Cooley
258259
William Lee
259260
Wim Glenn
260261
Wouter van Ackooy
262+
Xixi Zhao
261263
Xuan Luong
262264
Xuecong Liao
263265
Zac Hatfield-Dodds

CHANGELOG.rst

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=================
2-
Changelog history
3-
=================
1+
=========
2+
Changelog
3+
=========
44

55
Versions follow `Semantic Versioning <https://semver.org/>`_ (``<major>.<minor>.<patch>``).
66

@@ -90,6 +90,24 @@ Removals
9090
- `#5412 <https://github.com/pytest-dev/pytest/issues/5412>`_: ``ExceptionInfo`` objects (returned by ``pytest.raises``) now have the same ``str`` representation as ``repr``, which
9191
avoids some confusion when users use ``print(e)`` to inspect the object.
9292

93+
This means code like:
94+
95+
.. code-block:: python
96+
97+
with pytest.raises(SomeException) as e:
98+
...
99+
assert "some message" in str(e)
100+
101+
102+
Needs to be changed to:
103+
104+
.. code-block:: python
105+
106+
with pytest.raises(SomeException) as e:
107+
...
108+
assert "some message" in str(e.value)
109+
110+
93111
94112
95113
Deprecations
@@ -2173,10 +2191,10 @@ Features
21732191
design. This introduces new ``Node.iter_markers(name)`` and
21742192
``Node.get_closest_marker(name)`` APIs. Users are **strongly encouraged** to
21752193
read the `reasons for the revamp in the docs
2176-
<https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration>`_,
2194+
<https://docs.pytest.org/en/latest/historical-notes.html#marker-revamp-and-iteration>`_,
21772195
or jump over to details about `updating existing code to use the new APIs
2178-
<https://docs.pytest.org/en/latest/mark.html#updating-code>`_. (`#3317
2179-
<https://github.com/pytest-dev/pytest/issues/3317>`_)
2196+
<https://docs.pytest.org/en/latest/historical-notes.html#updating-code>`_.
2197+
(`#3317 <https://github.com/pytest-dev/pytest/issues/3317>`_)
21802198

21812199
- Now when ``@pytest.fixture`` is applied more than once to the same function a
21822200
``ValueError`` is raised. This buggy behavior would cause surprising problems
@@ -2582,10 +2600,10 @@ Features
25822600
<https://github.com/pytest-dev/pytest/issues/3038>`_)
25832601

25842602
- New `pytest_runtest_logfinish
2585-
<https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_logfinish>`_
2603+
<https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_runtest_logfinish>`_
25862604
hook which is called when a test item has finished executing, analogous to
25872605
`pytest_runtest_logstart
2588-
<https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_start>`_.
2606+
<https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_runtest_logstart>`_.
25892607
(`#3101 <https://github.com/pytest-dev/pytest/issues/3101>`_)
25902608

25912609
- Improve performance when collecting tests using many fixtures. (`#3107
@@ -3575,7 +3593,7 @@ Bug Fixes
35753593
Thanks `@sirex`_ for the report and `@nicoddemus`_ for the PR.
35763594

35773595
* Replace ``raise StopIteration`` usages in the code by simple ``returns`` to finish generators, in accordance to `PEP-479`_ (`#2160`_).
3578-
Thanks `@tgoodlet`_ for the report and `@nicoddemus`_ for the PR.
3596+
Thanks to `@nicoddemus`_ for the PR.
35793597

35803598
* Fix internal errors when an unprintable ``AssertionError`` is raised inside a test.
35813599
Thanks `@omerhadari`_ for the PR.
@@ -3706,7 +3724,7 @@ Bug Fixes
37063724

37073725
.. _@syre: https://github.com/syre
37083726
.. _@adler-j: https://github.com/adler-j
3709-
.. _@d-b-w: https://bitbucket.org/d-b-w/
3727+
.. _@d-b-w: https://github.com/d-b-w
37103728
.. _@DuncanBetts: https://github.com/DuncanBetts
37113729
.. _@dupuy: https://bitbucket.org/dupuy/
37123730
.. _@kerrick-lyft: https://github.com/kerrick-lyft
@@ -3766,7 +3784,7 @@ Bug Fixes
37663784

37673785
.. _@adborden: https://github.com/adborden
37683786
.. _@cwitty: https://github.com/cwitty
3769-
.. _@d_b_w: https://github.com/d_b_w
3787+
.. _@d_b_w: https://github.com/d-b-w
37703788
.. _@gdyuldin: https://github.com/gdyuldin
37713789
.. _@matclab: https://github.com/matclab
37723790
.. _@MSeifert04: https://github.com/MSeifert04
@@ -3801,7 +3819,7 @@ Bug Fixes
38013819
Thanks `@axil`_ for the PR.
38023820

38033821
* Explain a bad scope value passed to ``@fixture`` declarations or
3804-
a ``MetaFunc.parametrize()`` call. Thanks `@tgoodlet`_ for the PR.
3822+
a ``MetaFunc.parametrize()`` call.
38053823

38063824
* This version includes ``pluggy-0.4.0``, which correctly handles
38073825
``VersionConflict`` errors in plugins (`#704`_).
@@ -3811,7 +3829,6 @@ Bug Fixes
38113829
.. _@philpep: https://github.com/philpep
38123830
.. _@raquel-ucl: https://github.com/raquel-ucl
38133831
.. _@axil: https://github.com/axil
3814-
.. _@tgoodlet: https://github.com/tgoodlet
38153832
.. _@vlad-dragos: https://github.com/vlad-dragos
38163833

38173834
.. _#1853: https://github.com/pytest-dev/pytest/issues/1853
@@ -4157,7 +4174,7 @@ time or change existing behaviors in order to make them less surprising/more use
41574174
* Updated docstrings with a more uniform style.
41584175

41594176
* Add stderr write for ``pytest.exit(msg)`` during startup. Previously the message was never shown.
4160-
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@JonathonSonesen`_ and
4177+
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@jgsonesen`_ and
41614178
`@tomviner`_ for the PR.
41624179

41634180
* No longer display the incorrect test deselection reason (`#1372`_).
@@ -4205,7 +4222,7 @@ time or change existing behaviors in order to make them less surprising/more use
42054222
Thanks to `@Stranger6667`_ for the PR.
42064223

42074224
* Fixed the total tests tally in junit xml output (`#1798`_).
4208-
Thanks to `@cryporchild`_ for the PR.
4225+
Thanks to `@cboelsen`_ for the PR.
42094226

42104227
* Fixed off-by-one error with lines from ``request.node.warn``.
42114228
Thanks to `@blueyed`_ for the PR.
@@ -4278,7 +4295,7 @@ time or change existing behaviors in order to make them less surprising/more use
42784295
.. _@BeyondEvil: https://github.com/BeyondEvil
42794296
.. _@blueyed: https://github.com/blueyed
42804297
.. _@ceridwen: https://github.com/ceridwen
4281-
.. _@cryporchild: https://github.com/cryporchild
4298+
.. _@cboelsen: https://github.com/cboelsen
42824299
.. _@csaftoiu: https://github.com/csaftoiu
42834300
.. _@d6e: https://github.com/d6e
42844301
.. _@davehunt: https://github.com/davehunt
@@ -4289,7 +4306,7 @@ time or change existing behaviors in order to make them less surprising/more use
42894306
.. _@gprasad84: https://github.com/gprasad84
42904307
.. _@graingert: https://github.com/graingert
42914308
.. _@hartym: https://github.com/hartym
4292-
.. _@JonathonSonesen: https://github.com/JonathonSonesen
4309+
.. _@jgsonesen: https://github.com/jgsonesen
42934310
.. _@kalekundert: https://github.com/kalekundert
42944311
.. _@kvas-it: https://github.com/kvas-it
42954312
.. _@marscher: https://github.com/marscher
@@ -4426,7 +4443,7 @@ time or change existing behaviors in order to make them less surprising/more use
44264443

44274444
**Changes**
44284445

4429-
* **Important**: `py.code <https://pylib.readthedocs.io/en/latest/code.html>`_ has been
4446+
* **Important**: `py.code <https://pylib.readthedocs.io/en/stable/code.html>`_ has been
44304447
merged into the ``pytest`` repository as ``pytest._code``. This decision
44314448
was made because ``py.code`` had very few uses outside ``pytest`` and the
44324449
fact that it was in a different repository made it difficult to fix bugs on

CONTRIBUTING.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Contribution getting started
55
Contributions are highly welcomed and appreciated. Every little help counts,
66
so do not hesitate!
77

8-
.. contents:: Contribution links
8+
.. contents::
99
:depth: 2
10+
:backlinks: none
1011

1112

1213
.. _submitfeedback:

OPENCOLLECTIVE.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ What is it
99
==========
1010

1111
Open Collective is an online funding platform for open and transparent communities.
12-
It provide tools to raise money and share your finances in full transparency.
12+
It provides tools to raise money and share your finances in full transparency.
1313

1414
It is the platform of choice for individuals and companies that want to make one-time or
1515
monthly donations directly to the project.
@@ -19,7 +19,7 @@ Funds
1919

2020
The OpenCollective funds donated to pytest will be used to fund overall maintenance,
2121
local sprints, merchandising (stickers to distribute in conferences for example), and future
22-
gatherings of pytest developers (Sprints).
22+
gatherings of pytest developers (sprints).
2323

2424
`Core contributors`_ which are contributing on a continuous basis are free to submit invoices
2525
to bill maintenance hours using the platform. How much each contributor should request is still an

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ Consult the `Changelog <https://docs.pytest.org/en/latest/changelog.html>`__ pag
111111
Support pytest
112112
--------------
113113

114-
You can support pytest by obtaining a `Tideflift subscription`_.
114+
You can support pytest by obtaining a `Tidelift subscription`_.
115115

116116
Tidelift gives software development teams a single source for purchasing and maintaining their software,
117117
with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.
118118

119119

120-
.. _`Tideflift subscription`: https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=readme
120+
.. _`Tidelift subscription`: https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=readme
121121

122122

123123
Security

changelog/5516.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cache node splitting function which can improve collection performance in very large test suites.

changelog/5524.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
2+
which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.

changelog/5578.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Improve type checking for some exception-raising functions (``pytest.xfail``, ``pytest.skip``, etc)
2+
so they provide better error messages when users meant to use marks (for example ``@pytest.xfail``
3+
instead of ``@pytest.mark.xfail``).

0 commit comments

Comments
 (0)