Skip to content

Commit eaf7ce9

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

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

+361
-228
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.

0 commit comments

Comments
 (0)