Skip to content

Commit fd2f320

Browse files
committed
Preparing release version 5.0.0
1 parent 73d918d commit fd2f320

35 files changed

+301
-159
lines changed

CHANGELOG.rst

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,184 @@ with advance notice in the **Deprecations** section of releases.
1818
1919
.. towncrier release notes start
2020
21+
pytest 5.0.0 (2019-06-28)
22+
=========================
23+
24+
Removals
25+
--------
26+
27+
- `#1149 <https://github.com/pytest-dev/pytest/issues/1149>`_: Pytest no longer accepts prefixes of command-line arguments, for example
28+
typing ``pytest --doctest-mod`` inplace of ``--doctest-modules``.
29+
This was previously allowed where the ``ArgumentParser`` thought it was unambiguous,
30+
but this could be incorrect due to delayed parsing of options for plugins.
31+
See for example issues `#1149 <https://github.com/pytest-dev/pytest/issues/1149>`__,
32+
`#3413 <https://github.com/pytest-dev/pytest/issues/3413>`__, and
33+
`#4009 <https://github.com/pytest-dev/pytest/issues/4009>`__.
34+
35+
36+
- `#5125 <https://github.com/pytest-dev/pytest/issues/5125>`_: ``Session.exitcode`` values are now coded in ``pytest.ExitCode``, an ``IntEnum``. This makes the exit code available for consumer code and are more explicit other than just documentation. User defined exit codes are still valid, but should be used with caution.
37+
38+
The team doesn't expect this change to break test suites or plugins in general, except in esoteric/specific scenarios.
39+
40+
**pytest-xdist** users should upgrade to ``1.29.0`` or later, as ``pytest-xdist`` required a compatibility fix because of this change.
41+
42+
43+
- `#5402 <https://github.com/pytest-dev/pytest/issues/5402>`_: **PytestDeprecationWarning are now errors by default.**
44+
45+
Following our plan to remove deprecated features with as little disruption as
46+
possible, all warnings of type ``PytestDeprecationWarning`` now generate errors
47+
instead of warning messages.
48+
49+
**The affected features will be effectively removed in pytest 5.1**, so please consult the
50+
`Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`__
51+
section in the docs for directions on how to update existing code.
52+
53+
In the pytest ``5.0.X`` series, it is possible to change the errors back into warnings as a stop
54+
gap measure by adding this to your ``pytest.ini`` file:
55+
56+
.. code-block:: ini
57+
58+
[pytest]
59+
filterwarnings =
60+
ignore::pytest.PytestDeprecationWarning
61+
62+
But this will stop working when pytest ``5.1`` is released.
63+
64+
**If you have concerns** about the removal of a specific feature, please add a
65+
comment to `#5402 <https://github.com/pytest-dev/pytest/issues/5402>`__.
66+
67+
68+
- `#5412 <https://github.com/pytest-dev/pytest/issues/5412>`_: ``ExceptionInfo`` objects (returned by ``pytest.raises``) now have the same ``str`` representation as ``repr``, which
69+
avoids some confusion when users use ``print(e)`` to inspect the object.
70+
71+
72+
73+
Deprecations
74+
------------
75+
76+
- `#4488 <https://github.com/pytest-dev/pytest/issues/4488>`_: The removal of the ``--result-log`` option and module has been postponed to (tentatively) pytest 6.0 as
77+
the team has not yet got around to implement a good alternative for it.
78+
79+
80+
- `#466 <https://github.com/pytest-dev/pytest/issues/466>`_: The ``funcargnames`` attribute has been an alias for ``fixturenames`` since
81+
pytest 2.3, and is now deprecated in code too.
82+
83+
84+
85+
Features
86+
--------
87+
88+
- `#3457 <https://github.com/pytest-dev/pytest/issues/3457>`_: New `pytest_assertion_pass <https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_assertion_pass>`__
89+
hook, called with context information when an assertion *passes*.
90+
91+
This hook is still **experimental** so use it with caution.
92+
93+
94+
- `#5440 <https://github.com/pytest-dev/pytest/issues/5440>`_: The `faulthandler <https://docs.python.org/3/library/faulthandler.html>`__ standard library
95+
module is now enabled by default to help users diagnose crashes in C modules.
96+
97+
This functionality was provided by integrating the external
98+
`pytest-faulthandler <https://github.com/pytest-dev/pytest-faulthandler>`__ plugin into the core,
99+
so users should remove that plugin from their requirements if used.
100+
101+
For more information see the docs: https://docs.pytest.org/en/latest/usage.html#fault-handler
102+
103+
104+
- `#5452 <https://github.com/pytest-dev/pytest/issues/5452>`_: When warnings are configured as errors, pytest warnings now appear as originating from ``pytest.`` instead of the internal ``_pytest.warning_types.`` module.
105+
106+
107+
108+
Bug Fixes
109+
---------
110+
111+
- `#1403 <https://github.com/pytest-dev/pytest/issues/1403>`_: Switch from ``imp`` to ``importlib``.
112+
113+
114+
- `#1671 <https://github.com/pytest-dev/pytest/issues/1671>`_: The name of the ``.pyc`` files cached by the assertion writer now includes the pytest version
115+
to avoid stale caches.
116+
117+
118+
- `#2761 <https://github.com/pytest-dev/pytest/issues/2761>`_: Honor PEP 235 on case-insensitive file systems.
119+
120+
121+
- `#5078 <https://github.com/pytest-dev/pytest/issues/5078>`_: Test module is no longer double-imported when using ``--pyargs``.
122+
123+
124+
- `#5260 <https://github.com/pytest-dev/pytest/issues/5260>`_: Improved comparison of byte strings.
125+
126+
When comparing bytes, the assertion message used to show the byte numeric value when showing the differences::
127+
128+
def test():
129+
> assert b'spam' == b'eggs'
130+
E AssertionError: assert b'spam' == b'eggs'
131+
E At index 0 diff: 115 != 101
132+
E Use -v to get the full diff
133+
134+
It now shows the actual ascii representation instead, which is often more useful::
135+
136+
def test():
137+
> assert b'spam' == b'eggs'
138+
E AssertionError: assert b'spam' == b'eggs'
139+
E At index 0 diff: b's' != b'e'
140+
E Use -v to get the full diff
141+
142+
143+
- `#5335 <https://github.com/pytest-dev/pytest/issues/5335>`_: Colorize level names when the level in the logging format is formatted using
144+
'%(levelname).Xs' (truncated fixed width alignment), where X is an integer.
145+
146+
147+
- `#5354 <https://github.com/pytest-dev/pytest/issues/5354>`_: Fix ``pytest.mark.parametrize`` when the argvalues is an iterator.
148+
149+
150+
- `#5370 <https://github.com/pytest-dev/pytest/issues/5370>`_: Revert unrolling of ``all()`` to fix ``NameError`` on nested comprehensions.
151+
152+
153+
- `#5371 <https://github.com/pytest-dev/pytest/issues/5371>`_: Revert unrolling of ``all()`` to fix incorrect handling of generators with ``if``.
154+
155+
156+
- `#5372 <https://github.com/pytest-dev/pytest/issues/5372>`_: Revert unrolling of ``all()`` to fix incorrect assertion when using ``all()`` in an expression.
157+
158+
159+
- `#5383 <https://github.com/pytest-dev/pytest/issues/5383>`_: ``-q`` has again an impact on the style of the collected items
160+
(``--collect-only``) when ``--log-cli-level`` is used.
161+
162+
163+
- `#5389 <https://github.com/pytest-dev/pytest/issues/5389>`_: Fix regressions of `#5063 <https://github.com/pytest-dev/pytest/pull/5063>`__ for ``importlib_metadata.PathDistribution`` which have their ``files`` attribute being ``None``.
164+
165+
166+
- `#5390 <https://github.com/pytest-dev/pytest/issues/5390>`_: Fix regression where the ``obj`` attribute of ``TestCase`` items was no longer bound to methods.
167+
168+
169+
- `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception,
170+
for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__).
171+
172+
173+
- `#5432 <https://github.com/pytest-dev/pytest/issues/5432>`_: Prevent "already imported" warnings from assertion rewriter when invoking pytest in-process multiple times.
174+
175+
176+
- `#5433 <https://github.com/pytest-dev/pytest/issues/5433>`_: Fix assertion rewriting in packages (``__init__.py``).
177+
178+
179+
- `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect.
180+
181+
182+
- `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing
183+
more than 2 positional arguments to ``pytest.mark.parametrize``.
184+
185+
186+
- `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``.
187+
188+
189+
190+
Improved Documentation
191+
----------------------
192+
193+
- `#5315 <https://github.com/pytest-dev/pytest/issues/5315>`_: Expand docs on mocking classes and dictionaries with ``monkeypatch``.
194+
195+
196+
- `#5416 <https://github.com/pytest-dev/pytest/issues/5416>`_: Fix PytestUnknownMarkWarning in run/skip example.
197+
198+
21199
pytest 4.6.3 (2019-06-11)
22200
=========================
23201

changelog/1149.removal.rst

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

changelog/1403.bugfix.rst

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

changelog/1671.bugfix.rst

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

changelog/2761.bugfix.rst

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

changelog/3457.feature.rst

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

changelog/4488.deprecation.rst

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

changelog/466.deprecation.rst

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

changelog/5078.bugfix.rst

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

changelog/5125.removal.rst

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

changelog/5260.bugfix.rst

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

changelog/5315.doc.rst

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

changelog/5335.bugfix.rst

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

changelog/5354.bugfix.rst

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

changelog/5370.bugfix.rst

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

changelog/5371.bugfix.rst

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

changelog/5372.bugfix.rst

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

changelog/5383.bugfix.rst

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

changelog/5389.bugfix.rst

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

changelog/5390.bugfix.rst

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

changelog/5402.removal.rst

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

changelog/5404.bugfix.rst

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

changelog/5412.removal.rst

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

changelog/5416.doc.rst

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

changelog/5432.bugfix.rst

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

changelog/5433.bugfix.rst

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

changelog/5440.feature.rst

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

changelog/5444.bugfix.rst

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

changelog/5452.feature.rst

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

changelog/5482.bugfix.rst

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

changelog/5505.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.0.0
910
release-4.6.3
1011
release-4.6.2
1112
release-4.6.1

doc/en/announce/release-5.0.0.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
pytest-5.0.0
2+
=======================================
3+
4+
The pytest team is proud to announce the 5.0.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+
* Dirk Thomas
28+
* Evan Kepner
29+
* Florian Bruhin
30+
* Hugo
31+
* Kevin J. Foley
32+
* Pulkit Goyal
33+
* Ralph Giles
34+
* Ronny Pfannschmidt
35+
* Thomas Grainger
36+
* Thomas Hisch
37+
* Tim Gates
38+
* Victor Maryama
39+
* Yuri Apollov
40+
* Zac Hatfield-Dodds
41+
* Zac-HD
42+
* curiousjazz77
43+
* patriksevallius
44+
45+
46+
Happy testing,
47+
The Pytest Development Team

doc/en/example/parametrize.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,16 @@ Running it results in some skips if we don't have all the python interpreters in
434434
.. code-block:: pytest
435435
436436
. $ pytest -rs -q multipython.py
437-
...sss...sssssssss...sss... [100%]
437+
ssssssssssss......sss...... [100%]
438+
============================= warnings summary =============================
439+
$PYTHON_PREFIX/lib/python3.6/distutils/__init__.py:1
440+
$PYTHON_PREFIX/lib/python3.6/distutils/__init__.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
441+
import imp
442+
443+
-- Docs: https://docs.pytest.org/en/latest/warnings.html
438444
========================= short test summary info ==========================
439-
SKIPPED [15] $REGENDOC_TMPDIR/CWD/multipython.py:31: 'python3.4' not found
440-
12 passed, 15 skipped in 0.12 seconds
445+
SKIPPED [15] $REGENDOC_TMPDIR/CWD/multipython.py:30: 'python3.5' not found
446+
12 passed, 15 skipped, 1 warnings in 0.12 seconds
441447
442448
Indirect parametrization of optional implementations/imports
443449
--------------------------------------------------------------------

0 commit comments

Comments
 (0)