Skip to content

Commit 717839f

Browse files
committed
Preparing release version 5.1.0
1 parent 409d61b commit 717839f

Some content is hidden

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

50 files changed

+416
-295
lines changed

CHANGELOG.rst

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,164 @@ with advance notice in the **Deprecations** section of releases.
1818
1919
.. towncrier release notes start
2020
21+
pytest 5.1.0 (2019-08-15)
22+
=========================
23+
24+
Removals
25+
--------
26+
27+
- `#5180 <https://github.com/pytest-dev/pytest/issues/5180>`_: As per our policy, the following features have been deprecated in the 4.X series and are now
28+
removed:
29+
30+
* ``Request.getfuncargvalue``: use ``Request.getfixturevalue`` instead.
31+
32+
* ``pytest.raises`` and ``pytest.warns`` no longer support strings as the second argument.
33+
34+
* ``message`` parameter of ``pytest.raises``.
35+
36+
* ``pytest.raises``, ``pytest.warns`` and ``ParameterSet.param`` now use native keyword-only
37+
syntax. This might change the exception message from previous versions, but they still raise
38+
``TypeError`` on unknown keyword arguments as before.
39+
40+
* ``pytest.config`` global variable.
41+
42+
* ``tmpdir_factory.ensuretemp`` method.
43+
44+
* ``pytest_logwarning`` hook.
45+
46+
* ``RemovedInPytest4Warning`` warning type.
47+
48+
* ``request`` is now a reserved name for fixtures.
49+
50+
51+
For more information consult
52+
`Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`__ in the docs.
53+
54+
55+
- `#5565 <https://github.com/pytest-dev/pytest/issues/5565>`_: Removed unused support code for `unittest2 <https://pypi.org/project/unittest2/>`__.
56+
57+
The ``unittest2`` backport module is no longer
58+
necessary since Python 3.3+, and the small amount of code in pytest to support it also doesn't seem
59+
to be used: after removed, all tests still pass unchanged.
60+
61+
Although our policy is to introduce a deprecation period before removing any features or support
62+
for third party libraries, because this code is apparently not used
63+
at all (even if ``unittest2`` is used by a test suite executed by pytest), it was decided to
64+
remove it in this release.
65+
66+
If you experience a regression because of this, please
67+
`file an issue <https://github.com/pytest-dev/pytest/issues/new>`__.
68+
69+
70+
- `#5615 <https://github.com/pytest-dev/pytest/issues/5615>`_: ``pytest.fail``, ``pytest.xfail`` and ``pytest.skip`` no longer support bytes for the message argument.
71+
72+
This was supported for Python 2 where it was tempting to use ``"message"``
73+
instead of ``u"message"``.
74+
75+
Python 3 code is unlikely to pass ``bytes`` to these functions. If you do,
76+
please decode it to an ``str`` beforehand.
77+
78+
79+
80+
Features
81+
--------
82+
83+
- `#5564 <https://github.com/pytest-dev/pytest/issues/5564>`_: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``.
84+
85+
86+
- `#5576 <https://github.com/pytest-dev/pytest/issues/5576>`_: New `NUMBER <https://docs.pytest.org/en/latest/doctest.html#using-doctest-options>`__
87+
option for doctests to ignore irrelevant differences in floating-point numbers.
88+
Inspired by Sébastien Boisgérault's `numtest <https://github.com/boisgera/numtest>`__
89+
extension for doctest.
90+
91+
92+
93+
Improvements
94+
------------
95+
96+
- `#5471 <https://github.com/pytest-dev/pytest/issues/5471>`_: JUnit XML now includes a timestamp and hostname in the testsuite tag.
97+
98+
99+
- `#5707 <https://github.com/pytest-dev/pytest/issues/5707>`_: Time taken to run the test suite now includes a human-readable representation when it takes over
100+
60 seconds, for example::
101+
102+
===== 2 failed in 102.70s (0:01:42) =====
103+
104+
105+
106+
Bug Fixes
107+
---------
108+
109+
- `#4344 <https://github.com/pytest-dev/pytest/issues/4344>`_: Fix RuntimeError/StopIteration when trying to collect package with "__init__.py" only.
110+
111+
112+
- `#5115 <https://github.com/pytest-dev/pytest/issues/5115>`_: Warnings issued during ``pytest_configure`` are explicitly not treated as errors, even if configured as such, because it otherwise completely breaks pytest.
113+
114+
115+
- `#5477 <https://github.com/pytest-dev/pytest/issues/5477>`_: The XML file produced by ``--junitxml`` now correctly contain a ``<testsuites>`` root element.
116+
117+
118+
- `#5523 <https://github.com/pytest-dev/pytest/issues/5523>`_: Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+.
119+
120+
121+
- `#5524 <https://github.com/pytest-dev/pytest/issues/5524>`_: Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
122+
which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.
123+
124+
125+
- `#5537 <https://github.com/pytest-dev/pytest/issues/5537>`_: Replace ``importlib_metadata`` backport with ``importlib.metadata`` from the
126+
standard library on Python 3.8+.
127+
128+
129+
- `#5578 <https://github.com/pytest-dev/pytest/issues/5578>`_: Improve type checking for some exception-raising functions (``pytest.xfail``, ``pytest.skip``, etc)
130+
so they provide better error messages when users meant to use marks (for example ``@pytest.xfail``
131+
instead of ``@pytest.mark.xfail``).
132+
133+
134+
- `#5606 <https://github.com/pytest-dev/pytest/issues/5606>`_: Fixed internal error when test functions were patched with objects that cannot be compared
135+
for truth values against others, like ``numpy`` arrays.
136+
137+
138+
- `#5634 <https://github.com/pytest-dev/pytest/issues/5634>`_: ``pytest.exit`` is now correctly handled in ``unittest`` cases.
139+
This makes ``unittest`` cases handle ``quit`` from pytest's pdb correctly.
140+
141+
142+
- `#5650 <https://github.com/pytest-dev/pytest/issues/5650>`_: Improved output when parsing an ini configuration file fails.
143+
144+
145+
- `#5701 <https://github.com/pytest-dev/pytest/issues/5701>`_: Fix collection of ``staticmethod`` objects defined with ``functools.partial``.
146+
147+
148+
- `#5734 <https://github.com/pytest-dev/pytest/issues/5734>`_: Skip async generator test functions, and update the warning message to refer to ``async def`` functions.
149+
150+
151+
152+
Improved Documentation
153+
----------------------
154+
155+
- `#5669 <https://github.com/pytest-dev/pytest/issues/5669>`_: Add docstring for ``Testdir.copy_example``.
156+
157+
158+
159+
Trivial/Internal Changes
160+
------------------------
161+
162+
- `#5095 <https://github.com/pytest-dev/pytest/issues/5095>`_: XML files of the ``xunit2`` family are now validated against the schema by pytest's own test suite
163+
to avoid future regressions.
164+
165+
166+
- `#5516 <https://github.com/pytest-dev/pytest/issues/5516>`_: Cache node splitting function which can improve collection performance in very large test suites.
167+
168+
169+
- `#5603 <https://github.com/pytest-dev/pytest/issues/5603>`_: Simplified internal ``SafeRepr`` class and removed some dead code.
170+
171+
172+
- `#5664 <https://github.com/pytest-dev/pytest/issues/5664>`_: When invoking pytest's own testsuite with ``PYTHONDONTWRITEBYTECODE=1``,
173+
the ``test_xfail_handling`` test no longer fails.
174+
175+
176+
- `#5684 <https://github.com/pytest-dev/pytest/issues/5684>`_: Replace manual handling of ``OSError.errno`` in the codebase by new ``OSError`` subclasses (``PermissionError``, ``FileNotFoundError``, etc.).
177+
178+
21179
pytest 5.0.1 (2019-07-04)
22180
=========================
23181

changelog/4344.bugfix.rst

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

changelog/5095.trivial.rst

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

changelog/5115.bugfix.rst

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

changelog/5180.removal.rst

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

changelog/5471.improvement.rst

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

changelog/5477.bugfix.rst

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

changelog/5516.trivial.rst

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

changelog/5523.bugfix.rst

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

changelog/5524.bugfix.rst

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

changelog/5537.bugfix.rst

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

changelog/5564.feature.rst

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

changelog/5565.removal.rst

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

changelog/5576.feature.rst

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

changelog/5578.bugfix.rst

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

changelog/5603.trivial.rst

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

changelog/5606.bugfix.rst

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

changelog/5615.removal.rst

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

changelog/5634.bugfix.rst

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

changelog/5650.bugfix.rst

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

changelog/5664.trivial.rst

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

changelog/5669.doc.rst

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

changelog/5684.trivial.rst

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

changelog/5701.bugfix.rst

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

changelog/5707.improvement.rst

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

changelog/5734.bugfix.rst

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

doc/en/announce/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-5.1.0
910
release-5.0.1
1011
release-5.0.0
1112
release-4.6.5

doc/en/announce/release-5.1.0.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
pytest-5.1.0
2+
=======================================
3+
4+
The pytest team is proud to announce the 5.1.0 release!
5+
6+
pytest is a mature Python testing tool with more than a 2000 tests
7+
against itself, passing on many different interpreters and platforms.
8+
9+
This release contains a number of bugs fixes and improvements, so users are encouraged
10+
to take a look at the CHANGELOG:
11+
12+
https://docs.pytest.org/en/latest/changelog.html
13+
14+
For complete documentation, please visit:
15+
16+
https://docs.pytest.org/en/latest/
17+
18+
As usual, you can upgrade from pypi via:
19+
20+
pip install -U pytest
21+
22+
Thanks to all who contributed to this release, among them:
23+
24+
* Anthony Sottile
25+
* Bruno Oliveira
26+
* Daniel Hahler
27+
* David Röthlisberger
28+
* Florian Bruhin
29+
* Ilya Stepin
30+
* Jon Dufresne
31+
* Miro Hrončok
32+
* Ran Benita
33+
* Ronny Pfannschmidt
34+
* Samuel Searles-Bryant
35+
* Thomas Grainger
36+
* Tim Hoffmann
37+
* boris
38+
* dmitry.dygalo
39+
* martbln
40+
* mei-li
41+
42+
43+
Happy testing,
44+
The Pytest Development Team

doc/en/assert.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ you will see the return value of the function call:
3131
3232
$ pytest test_assert1.py
3333
=========================== test session starts ============================
34-
platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y
34+
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
3535
cachedir: $PYTHON_PREFIX/.pytest_cache
3636
rootdir: $REGENDOC_TMPDIR
3737
collected 1 item
@@ -47,7 +47,7 @@ you will see the return value of the function call:
4747
E + where 3 = f()
4848
4949
test_assert1.py:6: AssertionError
50-
========================= 1 failed in 0.12 seconds =========================
50+
============================ 1 failed in 0.06s =============================
5151
5252
``pytest`` has support for showing the values of the most common subexpressions
5353
including calls, attributes, comparisons, and binary and unary
@@ -186,7 +186,7 @@ if you run this module:
186186
187187
$ pytest test_assert2.py
188188
=========================== test session starts ============================
189-
platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y
189+
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
190190
cachedir: $PYTHON_PREFIX/.pytest_cache
191191
rootdir: $REGENDOC_TMPDIR
192192
collected 1 item
@@ -208,7 +208,7 @@ if you run this module:
208208
E Use -v to get the full diff
209209
210210
test_assert2.py:6: AssertionError
211-
========================= 1 failed in 0.12 seconds =========================
211+
============================ 1 failed in 0.05s =============================
212212
213213
Special comparisons are done for a number of cases:
214214

@@ -279,7 +279,7 @@ the conftest file:
279279
E vals: 1 != 2
280280
281281
test_foocompare.py:12: AssertionError
282-
1 failed in 0.12 seconds
282+
1 failed in 0.04s
283283
284284
.. _assert-details:
285285
.. _`assert introspection`:

doc/en/builtin.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
160160
in python < 3.6 this is a pathlib2.Path
161161
162162
163-
no tests ran in 0.12 seconds
163+
no tests ran in 0.01s
164164
165165
You can also interactively ask for help, e.g. by typing on the Python interactive prompt something like:
166166

0 commit comments

Comments
 (0)