Skip to content

Commit 4b16b93

Browse files
committed
Preparing release version 5.3.0
1 parent 21622d0 commit 4b16b93

40 files changed

+260
-129
lines changed

CHANGELOG.rst

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,208 @@ with advance notice in the **Deprecations** section of releases.
1818
1919
.. towncrier release notes start
2020
21+
pytest 5.3.0 (2019-11-19)
22+
=========================
23+
24+
Deprecations
25+
------------
26+
27+
- `#6179 <https://github.com/pytest-dev/pytest/issues/6179>`_: The default value of ``junit_family`` option will change to ``xunit2`` in pytest 6.0, given
28+
that this is the version supported by default in modern tools that manipulate this type of file.
29+
30+
In order to smooth the transition, pytest will issue a warning in case the ``--junitxml`` option
31+
is given in the command line but ``junit_family`` is not explicitly configured in ``pytest.ini``.
32+
33+
For more information, `see the docs <https://docs.pytest.org/en/latest/deprecations.html#junit-family-default-value-change-to-xunit2>`__.
34+
35+
36+
37+
Features
38+
--------
39+
40+
- `#4488 <https://github.com/pytest-dev/pytest/issues/4488>`_: The pytest team has created the `pytest-reportlog <https://github.com/pytest-dev/pytest-reportlog>`__
41+
plugin, which provides a new ``--report-log=FILE`` option that writes *report logs* into a file as the test session executes.
42+
43+
Each line of the report log contains a self contained JSON object corresponding to a testing event,
44+
such as a collection or a test result report. The file is guaranteed to be flushed after writing
45+
each line, so systems can read and process events in real-time.
46+
47+
The plugin is meant to replace the ``--resultlog`` option, which is deprecated and meant to be removed
48+
in a future release. If you use ``--resultlog``, please try out ``pytest-reportlog`` and
49+
provide feedback.
50+
51+
52+
- `#4730 <https://github.com/pytest-dev/pytest/issues/4730>`_: When ``sys.pycache_prefix`` (Python 3.8+) is set, it will be used by pytest to cache test files changed by the assertion rewriting mechanism.
53+
54+
This makes it easier to benefit of cached ``.pyc`` files even on file systems without permissions.
55+
56+
57+
- `#5515 <https://github.com/pytest-dev/pytest/issues/5515>`_: Allow selective auto-indentation of multiline log messages.
58+
59+
Adds command line option ``--log-auto-indent``, config option
60+
``log_auto_indent`` and support for per-entry configuration of
61+
indentation behavior on calls to ``logging.log()``.
62+
63+
Alters the default for auto-indention from ``on`` to ``off``. This
64+
restores the older behavior that existed prior to v4.6.0. This
65+
reversion to earlier behavior was done because it is better to
66+
activate new features that may lead to broken tests explicitly
67+
rather than implicitly.
68+
69+
70+
- `#5914 <https://github.com/pytest-dev/pytest/issues/5914>`_: ``pytester`` learned two new functions, `no_fnmatch_line <https://docs.pytest.org/en/latest/reference.html#_pytest.pytester.LineMatcher.no_fnmatch_line>`_ and
71+
`no_re_match_line <https://docs.pytest.org/en/latest/reference.html#_pytest.pytester.LineMatcher.no_re_match_line>`_.
72+
73+
The functions are used to ensure the captured text *does not* match the given
74+
pattern.
75+
76+
The previous idiom was to use ``re.match``:
77+
78+
.. code-block:: python
79+
80+
assert re.match(pat, result.stdout.str()) is None
81+
82+
Or the ``in`` operator:
83+
84+
.. code-block:: python
85+
86+
assert text in result.stdout.str()
87+
88+
But the new functions produce best output on failure.
89+
90+
91+
- `#6057 <https://github.com/pytest-dev/pytest/issues/6057>`_: Add tolerances to complex values when printing ``pytest.approx``.
92+
93+
For example, ``repr(pytest.approx(3+4j))`` returns ``(3+4j) ± 5e-06 ∠ ±180°``. This is polar notation indicating a circle around the expected value, with a radius of 5e-06. For ``approx`` comparisons to return ``True``, the actual value should fall within this circle.
94+
95+
96+
- `#6061 <https://github.com/pytest-dev/pytest/issues/6061>`_: Adding the pluginmanager as an option ``pytest_addoption``
97+
so that hooks can be invoked when setting up command line options. This is
98+
useful for having one plugin communicate things to another plugin,
99+
such as default values or which set of command line options to add.
100+
101+
102+
103+
Improvements
104+
------------
105+
106+
- `#5061 <https://github.com/pytest-dev/pytest/issues/5061>`_: Use multiple colors with terminal summary statistics.
107+
108+
109+
- `#5630 <https://github.com/pytest-dev/pytest/issues/5630>`_: Quitting from debuggers is now properly handled in ``doctest`` items.
110+
111+
112+
- `#5924 <https://github.com/pytest-dev/pytest/issues/5924>`_: Improve verbose diff output with sequences.
113+
114+
Before:
115+
116+
.. code-block::
117+
118+
E AssertionError: assert ['version', '...version_info'] == ['version', '...version', ...]
119+
E Right contains 3 more items, first extra item: ' '
120+
E Full diff:
121+
E - ['version', 'version_info', 'sys.version', 'sys.version_info']
122+
E + ['version',
123+
E + 'version_info',
124+
E + 'sys.version',
125+
E + 'sys.version_info',
126+
E + ' ',
127+
E + 'sys.version',
128+
E + 'sys.version_info']
129+
130+
After:
131+
132+
.. code-block::
133+
134+
E AssertionError: assert ['version', '...version_info'] == ['version', '...version', ...]
135+
E Right contains 3 more items, first extra item: ' '
136+
E Full diff:
137+
E [
138+
E 'version',
139+
E 'version_info',
140+
E 'sys.version',
141+
E 'sys.version_info',
142+
E + ' ',
143+
E + 'sys.version',
144+
E + 'sys.version_info',
145+
E ]
146+
147+
148+
- `#5936 <https://github.com/pytest-dev/pytest/issues/5936>`_: Display untruncated assertion message with ``-vv``.
149+
150+
151+
- `#5990 <https://github.com/pytest-dev/pytest/issues/5990>`_: Fix plurality mismatch in test summary (e.g. display "1 error" instead of "1 errors").
152+
153+
154+
- `#6008 <https://github.com/pytest-dev/pytest/issues/6008>`_: ``Config.InvocationParams.args`` is now always a ``tuple`` to better convey that it should be
155+
immutable and avoid accidental modifications.
156+
157+
158+
- `#6023 <https://github.com/pytest-dev/pytest/issues/6023>`_: ``pytest.main`` returns a ``pytest.ExitCode`` instance now, except for when custom exit codes are used (where it returns ``int`` then still).
159+
160+
161+
- `#6026 <https://github.com/pytest-dev/pytest/issues/6026>`_: Align prefixes in output of pytester's ``LineMatcher``.
162+
163+
164+
- `#6059 <https://github.com/pytest-dev/pytest/issues/6059>`_: Collection errors are reported as errors (and not failures like before) in the terminal's short test summary.
165+
166+
167+
- `#6069 <https://github.com/pytest-dev/pytest/issues/6069>`_: ``pytester.spawn`` does not skip/xfail tests on FreeBSD anymore unconditionally.
168+
169+
170+
- `#6097 <https://github.com/pytest-dev/pytest/issues/6097>`_: The "[XXX%]" indicator in the test summary is colored according to the final (new) multi-colored line's main color.
171+
172+
173+
- `#6116 <https://github.com/pytest-dev/pytest/issues/6116>`_: Add ``--co`` as a synonym to ``--collect-only``.
174+
175+
176+
- `#6148 <https://github.com/pytest-dev/pytest/issues/6148>`_: ``atomicwrites`` is now only used on Windows, fixing a performance regression with assertion rewriting on Unix.
177+
178+
179+
- `#6152 <https://github.com/pytest-dev/pytest/issues/6152>`_: Now parametrization will use the ``__name__`` attribute of any object for the id, if present. Previously it would only use ``__name__`` for functions and classes.
180+
181+
182+
- `#6176 <https://github.com/pytest-dev/pytest/issues/6176>`_: Improved failure reporting with pytester's ``Hookrecorder.assertoutcome``.
183+
184+
185+
- `#6181 <https://github.com/pytest-dev/pytest/issues/6181>`_: The reason for a stopped session, e.g. with ``--maxfail`` / ``-x`` gets reported.
186+
187+
188+
- `#6206 <https://github.com/pytest-dev/pytest/issues/6206>`_: cacheprovider: improved robustness and performance with ``cache.set``.
189+
190+
191+
192+
Bug Fixes
193+
---------
194+
195+
- `#2049 <https://github.com/pytest-dev/pytest/issues/2049>`_: Fix ``-setup-plan`` showing inaccurate information about fixture lifetimes.
196+
197+
198+
- `#2548 <https://github.com/pytest-dev/pytest/issues/2548>`_: Fix line offset mismatch with skipped tests in terminal summary.
199+
200+
201+
- `#6039 <https://github.com/pytest-dev/pytest/issues/6039>`_: The ``PytestDoctestRunner`` is properly invalidated when unconfiguring the doctest plugin.
202+
203+
This is important when used with ``pytester``'s ``runpytest_inprocess``.
204+
205+
206+
- `#6047 <https://github.com/pytest-dev/pytest/issues/6047>`_: BaseExceptions are handled in ``saferepr``, which includes ``pytest.fail.Exception`` etc.
207+
208+
209+
- `#6074 <https://github.com/pytest-dev/pytest/issues/6074>`_: pytester: fix order of arguments in ``rm_rf`` warning when cleaning up temporary directories, and do not emit warnings for errors with ``os.open``.
210+
211+
212+
- `#6189 <https://github.com/pytest-dev/pytest/issues/6189>`_: Fix incorrect result of ``getmodpath`` method.
213+
214+
215+
216+
Trivial/Internal Changes
217+
------------------------
218+
219+
- `#4901 <https://github.com/pytest-dev/pytest/issues/4901>`_: ``RunResult`` from ``pytester`` now displays the mnemonic of the ``ret`` attribute when it is a
220+
valid ``pytest.ExitCode`` value.
221+
222+
21223
pytest 5.2.4 (2019-11-15)
22224
=========================
23225

changelog/2049.bugfix.rst

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

changelog/2548.bugfix.rst

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

changelog/4488.feature.rst

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

changelog/4730.feature.rst

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

changelog/4901.trivial.rst

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

changelog/5061.improvement.rst

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

changelog/5515.feature.rst

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

changelog/5630.improvement.rst

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

changelog/5914.feature.rst

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

0 commit comments

Comments
 (0)