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
Copy file name to clipboardExpand all lines: doc/en/changelog.rst
+44-62Lines changed: 44 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ Breaking Changes
82
82
the test suite.
83
83
84
84
85
-
- `#7122 <https://github.com/pytest-dev/pytest/issues/7122>`_: Expressions given to the ``-m`` and ``-k`` options are no longer evaluated using Python's ``eval()``.
85
+
- `#7122 <https://github.com/pytest-dev/pytest/issues/7122>`_: Expressions given to the ``-m`` and ``-k`` options are no longer evaluated using Python's :func:`eval`.
86
86
The format supports ``or``, ``and``, ``not``, parenthesis and general identifiers to match against.
87
87
Python constants, keywords or other operators are no longer evaluated differently.
88
88
@@ -113,7 +113,7 @@ Breaking Changes
113
113
- `#7226 <https://github.com/pytest-dev/pytest/issues/7226>`_: Removed the unused ``args`` parameter from ``pytest.Function.__init__``.
114
114
115
115
116
-
- `#7418 <https://github.com/pytest-dev/pytest/issues/7418>`_: Remove the `pytest_doctest_prepare_content` hook specification. This hook
116
+
- `#7418 <https://github.com/pytest-dev/pytest/issues/7418>`_: Removed the `pytest_doctest_prepare_content` hook specification. This hook
117
117
hasn't been triggered by pytest for at least 10 years.
118
118
119
119
@@ -134,25 +134,13 @@ Breaking Changes
134
134
Deprecations
135
135
------------
136
136
137
-
- `#6981 <https://github.com/pytest-dev/pytest/issues/6981>`_: Deprecate the ``pytest.collect`` module as it's just aliases into ``pytest``.
138
-
139
-
140
-
- `#7097 <https://github.com/pytest-dev/pytest/issues/7097>`_: The ``pytest._fillfuncargs`` function is now deprecated. This function was kept
141
-
for backward compatibility with an older plugin.
142
-
143
-
It's functionality is not meant to be used directly, but if you must replace
144
-
it, use `function._request._fillfixtures()` instead, though note this is not
145
-
a public API and may break in the future.
146
-
147
-
148
137
- `#7210 <https://github.com/pytest-dev/pytest/issues/7210>`_: The special ``-k '-expr'`` syntax to ``-k`` is deprecated. Use ``-k 'not expr'``
149
138
instead.
150
139
151
140
The special ``-k 'expr:'`` syntax to ``-k`` is deprecated. Please open an issue
152
141
if you use this and want a replacement.
153
142
154
143
155
-
156
144
Features
157
145
--------
158
146
@@ -192,22 +180,6 @@ Features
192
180
This hook is meant to replace `pytest_warning_captured`, which will be removed in a future release.
193
181
194
182
195
-
- `#6285 <https://github.com/pytest-dev/pytest/issues/6285>`_: Exposed the `pytest.FixtureLookupError` exception which is raised by `request.getfixturevalue()`
196
-
(where `request` is a `FixtureRequest` fixture) when a fixture with the given name cannot be returned.
197
-
198
-
199
-
- `#6433 <https://github.com/pytest-dev/pytest/issues/6433>`_: If an error is encountered while formatting the message in a logging call, for
200
-
example ``logging.warning("oh no!: %s: %s", "first")`` (a second argument is
201
-
missing), pytest now propagates the error, likely causing the test to fail.
202
-
203
-
Previously, such a mistake would cause an error to be printed to stderr, which
204
-
is not displayed by default for passing tests. This change makes the mistake
205
-
visible during testing.
206
-
207
-
You may supress this behavior temporarily or permanently by setting
208
-
``logging.raiseExceptions = False``.
209
-
210
-
211
183
- `#6471 <https://github.com/pytest-dev/pytest/issues/6471>`_: New command-line flags:
212
184
213
185
* `--no-header`: disables the initial header, including platform, version, and plugins.
@@ -238,17 +210,13 @@ Features
238
210
You can read more about this option in `the documentation <https://docs.pytest.org/en/latest/pythonpath.html#import-modes>`__.
239
211
240
212
241
-
- `#7305 <https://github.com/pytest-dev/pytest/issues/7305>`_: New ``required_plugins`` configuration option allows the user to specify a list of plugins required for pytest to run. An error is raised if any required plugins are not found when running pytest.
242
-
243
-
244
-
- `#7346 <https://github.com/pytest-dev/pytest/issues/7346>`_: Version information as defined by `PEP 440 <https://www.python.org/dev/peps/pep-0440/#version-specifiers>`_ may now be included when providing plugins to the ``required_plugins`` configuration option.
245
-
213
+
- `#7305 <https://github.com/pytest-dev/pytest/issues/7305>`_: New ``required_plugins`` configuration option allows the user to specify a list of plugins, including version information, that are required for pytest to run. An error is raised if any required plugins are not found when running pytest.
246
214
247
215
248
216
Improvements
249
217
------------
250
218
251
-
- `#4375 <https://github.com/pytest-dev/pytest/issues/4375>`_: The ``pytest`` command now supresses the ``BrokenPipeError`` error message that
219
+
- `#4375 <https://github.com/pytest-dev/pytest/issues/4375>`_: The ``pytest`` command now suppresses the ``BrokenPipeError`` error message that
252
220
is printed to stderr when the output of ``pytest`` is piped and and the pipe is
253
221
closed by the piped-to program (common examples are ``less`` and ``head``).
254
222
@@ -259,11 +227,27 @@ Improvements
259
227
- `#4675 <https://github.com/pytest-dev/pytest/issues/4675>`_: Rich comparison for dataclasses and `attrs`-classes is now recursive.
260
228
261
229
230
+
- `#6285 <https://github.com/pytest-dev/pytest/issues/6285>`_: Exposed the `pytest.FixtureLookupError` exception which is raised by `request.getfixturevalue()`
231
+
(where `request` is a `FixtureRequest` fixture) when a fixture with the given name cannot be returned.
232
+
233
+
234
+
- `#6433 <https://github.com/pytest-dev/pytest/issues/6433>`_: If an error is encountered while formatting the message in a logging call, for
235
+
example ``logging.warning("oh no!: %s: %s", "first")`` (a second argument is
236
+
missing), pytest now propagates the error, likely causing the test to fail.
237
+
238
+
Previously, such a mistake would cause an error to be printed to stderr, which
239
+
is not displayed by default for passing tests. This change makes the mistake
240
+
visible during testing.
241
+
242
+
You may supress this behavior temporarily or permanently by setting
243
+
``logging.raiseExceptions = False``.
244
+
245
+
262
246
- `#6817 <https://github.com/pytest-dev/pytest/issues/6817>`_: Explicit new-lines in help texts of command-line options are preserved, allowing plugins better control
263
247
of the help displayed to users.
264
248
265
249
266
-
- `#6940 <https://github.com/pytest-dev/pytest/issues/6940>`_: When using the ``--duration`` option, the terminal message output is now more precise about the number and durations of hidden items.
250
+
- `#6940 <https://github.com/pytest-dev/pytest/issues/6940>`_: When using the ``--duration`` option, the terminal message output is now more precise about the number and duration of hidden items.
267
251
268
252
269
253
- `#6991 <https://github.com/pytest-dev/pytest/issues/6991>`_: Collected files are displayed after any reports from hooks, e.g. the status from ``--lf``.
@@ -275,22 +259,18 @@ Improvements
275
259
file descriptors would fail or be lost in this case.
276
260
277
261
278
-
- `#7119 <https://github.com/pytest-dev/pytest/issues/7119>`_: Exit with an error if the ``--basetemp`` argument is empty, the current working directory or parent directory of it.
262
+
- `#7119 <https://github.com/pytest-dev/pytest/issues/7119>`_: Exit with an error if the ``--basetemp`` argument is empty, is the current working directory or is one of the parent directories.
279
263
This is done to protect against accidental data loss, as any directory passed to this argument is cleared.
280
264
281
265
282
-
- `#7128 <https://github.com/pytest-dev/pytest/issues/7128>`_: `pytest --version` now displays just the pytest version, while `pytest --version --version` displays more verbose information including plugins.
283
-
266
+
- `#7128 <https://github.com/pytest-dev/pytest/issues/7128>`_: `pytest --version` now displays just the pytest version, while `pytest --version --version` displays more verbose information including plugins. This is more consistent with how other tools show `--version`.
284
267
285
-
- `#7133 <https://github.com/pytest-dev/pytest/issues/7133>`_: ``caplog.set_level()`` will now override any :confval:`log_level` set via the CLI or ``.ini``.
286
268
269
+
- `#7133 <https://github.com/pytest-dev/pytest/issues/7133>`_: :meth:`caplog.set_level() <_pytest.logging.LogCaptureFixture.set_level>` will now override any :confval:`log_level` set via the CLI or configuration file.
287
270
288
-
- `#7159 <https://github.com/pytest-dev/pytest/issues/7159>`_: When the ``caplog`` fixture is used to change the log level for capturing,
289
-
using ``caplog.set_level()`` or ``caplog.at_level()``, it no longer affects
290
-
the level of logs that are shown in the "Captured log report" report section.
291
271
292
-
293
-
- `#7264 <https://github.com/pytest-dev/pytest/issues/7264>`_: The dependency on the ``wcwidth`` package has been removed.
272
+
- `#7159 <https://github.com/pytest-dev/pytest/issues/7159>`_: :meth:`caplog.set_level() <_pytest.logging.LogCaptureFixture.set_level>` and :meth:`caplog.at_level() <_pytest.logging.LogCaptureFixture.at_level>` no longer affect
273
+
the level of logs that are shown in the *Captured log report* report section.
294
274
295
275
296
276
- `#7348 <https://github.com/pytest-dev/pytest/issues/7348>`_: Improve recursive diff report for comparison asserts on dataclasses / attrs.
@@ -315,17 +295,17 @@ Improvements
315
295
Bug Fixes
316
296
---------
317
297
318
-
- `#1120 <https://github.com/pytest-dev/pytest/issues/1120>`_: Fix issue where directories from tmpdir are not removed properly when multiple instances of pytest are running in parallel.
298
+
- `#1120 <https://github.com/pytest-dev/pytest/issues/1120>`_: Fix issue where directories from :fixture:`tmpdir` are not removed properly when multiple instances of pytest are running in parallel.
319
299
320
300
321
-
- `#4583 <https://github.com/pytest-dev/pytest/issues/4583>`_: Prevent crashing and provide a user-friendly error when a marker expression (-m) invoking of eval() raises any exception.
301
+
- `#4583 <https://github.com/pytest-dev/pytest/issues/4583>`_: Prevent crashing and provide a user-friendly error when a marker expression (`-m`) invoking of :func:`eval` raises any exception.
322
302
323
303
324
304
- `#4677 <https://github.com/pytest-dev/pytest/issues/4677>`_: The path shown in the summary report for SKIPPED tests is now always relative. Previously it was sometimes absolute.
325
305
326
306
327
307
- `#5456 <https://github.com/pytest-dev/pytest/issues/5456>`_: Fix a possible race condition when trying to remove lock files used to control access to folders
328
-
created by ``tmp_path`` and ``tmpdir``.
308
+
created by :fixture:`tmp_path` and :fixture:`tmpdir`.
329
309
330
310
331
311
- `#6240 <https://github.com/pytest-dev/pytest/issues/6240>`_: Fixes an issue where logging during collection step caused duplication of log
@@ -336,10 +316,10 @@ Bug Fixes
336
316
changed since the start of the session.
337
317
338
318
339
-
- `#6755 <https://github.com/pytest-dev/pytest/issues/6755>`_: Support deleting paths longer than 260 characters on windows created inside tmpdir.
319
+
- `#6755 <https://github.com/pytest-dev/pytest/issues/6755>`_: Support deleting paths longer than 260 characters on windows created inside :fixture:`tmpdir`.
340
320
341
321
342
-
- `#6871 <https://github.com/pytest-dev/pytest/issues/6871>`_: Fix crash with captured output when using the :fixture:`capsysbinary fixture <capsysbinary>`.
322
+
- `#6871 <https://github.com/pytest-dev/pytest/issues/6871>`_: Fix crash with captured output when using :fixture:`capsysbinary`.
343
323
344
324
345
325
- `#6909 <https://github.com/pytest-dev/pytest/issues/6909>`_: Revert the change introduced by `#6330 <https://github.com/pytest-dev/pytest/pull/6330>`_, which required all arguments to ``@pytest.mark.parametrize`` to be explicitly defined in the function signature.
@@ -353,22 +333,22 @@ Bug Fixes
353
333
- `#6924 <https://github.com/pytest-dev/pytest/issues/6924>`_: Ensure a ``unittest.IsolatedAsyncioTestCase`` is actually awaited.
354
334
355
335
356
-
- `#6925 <https://github.com/pytest-dev/pytest/issues/6925>`_: Fix TerminalRepr instances to be hashable again.
336
+
- `#6925 <https://github.com/pytest-dev/pytest/issues/6925>`_: Fix `TerminalRepr` instances to be hashable again.
357
337
358
338
359
-
- `#6947 <https://github.com/pytest-dev/pytest/issues/6947>`_: Fix regression where functions registered with ``TestCase.addCleanup`` were not being called on test failures.
339
+
- `#6947 <https://github.com/pytest-dev/pytest/issues/6947>`_: Fix regression where functions registered with :meth:`unittest.TestCase.addCleanup` were not being called on test failures.
360
340
361
341
362
342
- `#6951 <https://github.com/pytest-dev/pytest/issues/6951>`_: Allow users to still set the deprecated ``TerminalReporter.writer`` attribute.
363
343
364
344
365
-
- `#6956 <https://github.com/pytest-dev/pytest/issues/6956>`_: Prevent pytest from printing ConftestImportFailure traceback to stdout.
345
+
- `#6956 <https://github.com/pytest-dev/pytest/issues/6956>`_: Prevent pytest from printing `ConftestImportFailure` traceback to stdout.
366
346
367
347
368
348
- `#6991 <https://github.com/pytest-dev/pytest/issues/6991>`_: Fix regressions with `--lf` filtering too much since pytest 5.4.
369
349
370
350
371
-
- `#6992 <https://github.com/pytest-dev/pytest/issues/6992>`_: Revert "tmpdir: clean up indirection via config for factories" #6767 as it breaks pytest-xdist.
351
+
- `#6992 <https://github.com/pytest-dev/pytest/issues/6992>`_: Revert "tmpdir: clean up indirection via config for factories" `#6767<https://github.com/pytest-dev/pytest/issues/6767>`_ as it breaks pytest-xdist.
372
352
373
353
374
354
- `#7061 <https://github.com/pytest-dev/pytest/issues/7061>`_: When a yielding fixture fails to yield a value, report a test setup error instead of crashing.
@@ -384,7 +364,7 @@ Bug Fixes
384
364
parameter when Python is called with the ``-bb`` flag.
385
365
386
366
387
-
- `#7143 <https://github.com/pytest-dev/pytest/issues/7143>`_: Fix ``File.from_constructor`` so it forwards extra keyword arguments to the constructor.
367
+
- `#7143 <https://github.com/pytest-dev/pytest/issues/7143>`_: Fix :meth:`pytest.File.from_parent` so it forwards extra keyword arguments to the constructor.
388
368
389
369
390
370
- `#7145 <https://github.com/pytest-dev/pytest/issues/7145>`_: Classes with broken ``__getattribute__`` methods are displayed correctly during failures.
@@ -396,8 +376,7 @@ Bug Fixes
396
376
- `#7180 <https://github.com/pytest-dev/pytest/issues/7180>`_: Fix ``_is_setup_py`` for files encoded differently than locale.
397
377
398
378
399
-
- `#7215 <https://github.com/pytest-dev/pytest/issues/7215>`_: Fix regression where running with ``--pdb`` would call the ``tearDown`` methods of ``unittest.TestCase``
400
-
subclasses for skipped tests.
379
+
- `#7215 <https://github.com/pytest-dev/pytest/issues/7215>`_: Fix regression where running with ``--pdb`` would call :meth:`unittest.TestCase.tearDown` for skipped tests.
401
380
402
381
403
382
- `#7253 <https://github.com/pytest-dev/pytest/issues/7253>`_: When using ``pytest.fixture`` on a function directly, as in ``pytest.fixture(func)``,
@@ -416,13 +395,13 @@ Bug Fixes
416
395
Improved Documentation
417
396
----------------------
418
397
419
-
- `#7202 <https://github.com/pytest-dev/pytest/issues/7202>`_: The development guide now links to the contributing section of the docs and 'RELEASING.rst' on GitHub.
398
+
- `#7202 <https://github.com/pytest-dev/pytest/issues/7202>`_: The development guide now links to the contributing section of the docs and `RELEASING.rst` on GitHub.
420
399
421
400
422
401
- `#7233 <https://github.com/pytest-dev/pytest/issues/7233>`_: Add a note about ``--strict`` and ``--strict-markers`` and the preference for the latter one.
423
402
424
403
425
-
- `#7345 <https://github.com/pytest-dev/pytest/issues/7345>`_: Explain indirect parametrization and markers for fixtures
404
+
- `#7345 <https://github.com/pytest-dev/pytest/issues/7345>`_: Explain indirect parametrization and markers for fixtures.
426
405
427
406
428
407
@@ -433,16 +412,19 @@ Trivial/Internal Changes
433
412
provided explicitly, and is always set.
434
413
435
414
415
+
- `#7264 <https://github.com/pytest-dev/pytest/issues/7264>`_: The dependency on the ``wcwidth`` package has been removed.
416
+
417
+
436
418
- `#7291 <https://github.com/pytest-dev/pytest/issues/7291>`_: Replaced ``py.iniconfig`` with `iniconfig <https://pypi.org/project/iniconfig/>`__.
437
419
438
420
439
421
- `#7295 <https://github.com/pytest-dev/pytest/issues/7295>`_: ``src/_pytest/config/__init__.py`` now uses the ``warnings`` module to report warnings instead of ``sys.stderr.write``.
440
422
441
423
442
-
- `#7356 <https://github.com/pytest-dev/pytest/issues/7356>`_: Remove last internal uses of deprecated "slave" term from old pytest-xdist.
424
+
- `#7356 <https://github.com/pytest-dev/pytest/issues/7356>`_: Remove last internal uses of deprecated *slave* term from old ``pytest-xdist``.
443
425
444
426
445
-
- `#7357 <https://github.com/pytest-dev/pytest/issues/7357>`_: py>=1.8.2 is now required.
427
+
- `#7357 <https://github.com/pytest-dev/pytest/issues/7357>`_: ``py``>=1.8.2 is now required.
0 commit comments