You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `#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
+
- `#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.
108
+
109
+
The team doesn't expect this change to break test suites or plugins in general, except in esoteric/specific scenarios.
110
+
111
+
**pytest-xdist** users should upgrade to ``1.29.0`` or later, as ``pytest-xdist`` required a compatibility fix because of this change.
112
+
113
+
114
+
115
+
Bug Fixes
116
+
---------
117
+
118
+
- `#1403 <https://github.com/pytest-dev/pytest/issues/1403>`_: Switch from ``imp`` to ``importlib``.
119
+
120
+
121
+
- `#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
122
+
to avoid stale caches.
123
+
124
+
125
+
- `#2761 <https://github.com/pytest-dev/pytest/issues/2761>`_: Honor PEP 235 on case-insensitive file systems.
126
+
127
+
128
+
- `#5078 <https://github.com/pytest-dev/pytest/issues/5078>`_: Test module is no longer double-imported when using ``--pyargs``.
129
+
130
+
131
+
- `#5260 <https://github.com/pytest-dev/pytest/issues/5260>`_: Improved comparison of byte strings.
132
+
133
+
When comparing bytes, the assertion message used to show the byte numeric value when showing the differences::
134
+
135
+
def test():
136
+
> assert b'spam' == b'eggs'
137
+
E AssertionError: assert b'spam' == b'eggs'
138
+
E At index 0 diff: 115 != 101
139
+
E Use -v to get the full diff
140
+
141
+
It now shows the actual ascii representation instead, which is often more useful::
142
+
143
+
def test():
144
+
> assert b'spam' == b'eggs'
145
+
E AssertionError: assert b'spam' == b'eggs'
146
+
E At index 0 diff: b's' != b'e'
147
+
E Use -v to get the full diff
148
+
149
+
150
+
- `#5335 <https://github.com/pytest-dev/pytest/issues/5335>`_: Colorize level names when the level in the logging format is formatted using
151
+
'%(levelname).Xs' (truncated fixed width alignment), where X is an integer.
152
+
153
+
154
+
- `#5354 <https://github.com/pytest-dev/pytest/issues/5354>`_: Fix ``pytest.mark.parametrize`` when the argvalues is an iterator.
155
+
156
+
157
+
- `#5370 <https://github.com/pytest-dev/pytest/issues/5370>`_: Revert unrolling of ``all()`` to fix ``NameError`` on nested comprehensions.
158
+
159
+
160
+
- `#5371 <https://github.com/pytest-dev/pytest/issues/5371>`_: Revert unrolling of ``all()`` to fix incorrect handling of generators with ``if``.
161
+
162
+
163
+
- `#5372 <https://github.com/pytest-dev/pytest/issues/5372>`_: Revert unrolling of ``all()`` to fix incorrect assertion when using ``all()`` in an expression.
164
+
165
+
166
+
- `#5383 <https://github.com/pytest-dev/pytest/issues/5383>`_: ``-q`` has again an impact on the style of the collected items
167
+
(``--collect-only``) when ``--log-cli-level`` is used.
168
+
169
+
170
+
- `#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``.
171
+
172
+
173
+
- `#5390 <https://github.com/pytest-dev/pytest/issues/5390>`_: Fix regression where the ``obj`` attribute of ``TestCase`` items was no longer bound to methods.
174
+
175
+
176
+
- `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception,
177
+
for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__).
178
+
179
+
180
+
- `#5432 <https://github.com/pytest-dev/pytest/issues/5432>`_: Prevent "already imported" warnings from assertion rewriter when invoking pytest in-process multiple times.
181
+
182
+
183
+
- `#5433 <https://github.com/pytest-dev/pytest/issues/5433>`_: Fix assertion rewriting in packages (``__init__.py``).
184
+
185
+
186
+
- `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect.
187
+
188
+
189
+
- `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing
190
+
more than 2 positional arguments to ``pytest.mark.parametrize``.
191
+
192
+
193
+
- `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``.
194
+
195
+
196
+
197
+
Improved Documentation
198
+
----------------------
199
+
200
+
- `#5315 <https://github.com/pytest-dev/pytest/issues/5315>`_: Expand docs on mocking classes and dictionaries with ``monkeypatch``.
201
+
202
+
203
+
- `#5416 <https://github.com/pytest-dev/pytest/issues/5416>`_: Fix PytestUnknownMarkWarning in run/skip example.
204
+
205
+
206
+
pytest 4.6.4 (2019-06-28)
207
+
=========================
208
+
209
+
Bug Fixes
210
+
---------
211
+
212
+
- `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception,
213
+
for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__).
214
+
215
+
216
+
- `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect.
217
+
218
+
219
+
- `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing
220
+
more than 2 positional arguments to ``pytest.mark.parametrize``.
221
+
222
+
223
+
- `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``.
224
+
225
+
226
+
pytest 4.6.3 (2019-06-11)
227
+
=========================
228
+
229
+
Bug Fixes
230
+
---------
231
+
232
+
- `#5383 <https://github.com/pytest-dev/pytest/issues/5383>`_: ``-q`` has again an impact on the style of the collected items
233
+
(``--collect-only``) when ``--log-cli-level`` is used.
234
+
235
+
236
+
- `#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``.
237
+
238
+
239
+
- `#5390 <https://github.com/pytest-dev/pytest/issues/5390>`_: Fix regression where the ``obj`` attribute of ``TestCase`` items was no longer bound to methods.
240
+
241
+
242
+
pytest 4.6.2 (2019-06-03)
243
+
=========================
244
+
245
+
Bug Fixes
246
+
---------
247
+
248
+
- `#5370 <https://github.com/pytest-dev/pytest/issues/5370>`_: Revert unrolling of ``all()`` to fix ``NameError`` on nested comprehensions.
249
+
250
+
251
+
- `#5371 <https://github.com/pytest-dev/pytest/issues/5371>`_: Revert unrolling of ``all()`` to fix incorrect handling of generators with ``if``.
252
+
253
+
254
+
- `#5372 <https://github.com/pytest-dev/pytest/issues/5372>`_: Revert unrolling of ``all()`` to fix incorrect assertion when using ``all()`` in an expression.
0 commit comments