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
+79
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,85 @@ with advance notice in the **Deprecations** section of releases.
28
28
29
29
.. towncrier release notes start
30
30
31
+
pytest 8.2.0 (2024-04-27)
32
+
=========================
33
+
34
+
Deprecations
35
+
------------
36
+
37
+
- `#12069 <https://github.com/pytest-dev/pytest/issues/12069>`_: A deprecation warning is now raised when implementations of one of the following hooks request a deprecated ``py.path.local`` parameter instead of the ``pathlib.Path`` parameter which replaced it:
38
+
39
+
- :hook:`pytest_ignore_collect` - the ``path`` parameter - use ``collection_path`` instead.
40
+
- :hook:`pytest_collect_file` - the ``path`` parameter - use ``file_path`` instead.
41
+
- :hook:`pytest_pycollect_makemodule` - the ``path`` parameter - use ``module_path`` instead.
42
+
- :hook:`pytest_report_header` - the ``startdir`` parameter - use ``start_path`` instead.
43
+
- :hook:`pytest_report_collectionfinish` - the ``startdir`` parameter - use ``start_path`` instead.
44
+
45
+
The replacement parameters are available since pytest 7.0.0.
46
+
The old parameters will be removed in pytest 9.0.0.
47
+
48
+
See :ref:`legacy-path-hooks-deprecated` for more details.
49
+
50
+
51
+
52
+
Features
53
+
--------
54
+
55
+
- `#11871 <https://github.com/pytest-dev/pytest/issues/11871>`_: Added support for reading command line arguments from a file using the prefix character ``@``, like e.g.: ``pytest @tests.txt``. The file must have one argument per line.
56
+
57
+
58
+
59
+
Improvements
60
+
------------
61
+
62
+
- `#11523 <https://github.com/pytest-dev/pytest/issues/11523>`_: :func:`pytest.importorskip` will now issue a warning if the module could be found, but raised :class:`ImportError` instead of :class:`ModuleNotFoundError`.
63
+
64
+
The warning can be suppressed by passing ``exc_type=ImportError`` to :func:`pytest.importorskip`.
65
+
66
+
See :ref:`import-or-skip-import-error` for details.
67
+
68
+
69
+
- `#11728 <https://github.com/pytest-dev/pytest/issues/11728>`_: For ``unittest``-based tests, exceptions during class cleanup (as raised by functions registered with :meth:`TestCase.addClassCleanup <unittest.TestCase.addClassCleanup>`) are now reported instead of silently failing.
70
+
71
+
72
+
- `#11777 <https://github.com/pytest-dev/pytest/issues/11777>`_: Text is no longer truncated in the ``short test summary info`` section when ``-vv`` is given.
73
+
74
+
75
+
- `#12112 <https://github.com/pytest-dev/pytest/issues/12112>`_: Improve namespace packages detection when :confval:`consider_namespace_packages` is enabled, covering more situations (like editable installs).
76
+
77
+
78
+
- `#9502 <https://github.com/pytest-dev/pytest/issues/9502>`_: Added :envvar:`PYTEST_VERSION` environment variable which is defined at the start of the pytest session and undefined afterwards. It contains the value of ``pytest.__version__``, and among other things can be used to easily check if code is running from within a pytest run.
79
+
80
+
81
+
82
+
Bug Fixes
83
+
---------
84
+
85
+
- `#12065 <https://github.com/pytest-dev/pytest/issues/12065>`_: Fixed a regression in pytest 8.0.0 where test classes containing ``setup_method`` and tests using ``@staticmethod`` or ``@classmethod`` would crash with ``AttributeError: 'NoneType' object has no attribute 'setup_method'``.
86
+
87
+
Now the :attr:`request.instance <pytest.FixtureRequest.instance>` attribute of tests using ``@staticmethod`` and ``@classmethod`` is no longer ``None``, but a fresh instance of the class, like in non-static methods.
88
+
Previously it was ``None``, and all fixtures of such tests would share a single ``self``.
89
+
90
+
91
+
- `#12135 <https://github.com/pytest-dev/pytest/issues/12135>`_: Fix fixtures adding their finalizer multiple times to fixtures they request, causing unreliable and non-intuitive teardown ordering in some instances.
92
+
93
+
94
+
- `#12194 <https://github.com/pytest-dev/pytest/issues/12194>`_: Fixed a bug with ``--importmode=importlib`` and ``--doctest-modules`` where child modules did not appear as attributes in parent modules.
95
+
96
+
97
+
- `#1489 <https://github.com/pytest-dev/pytest/issues/1489>`_: Fix some instances where teardown of higher-scoped fixtures was not happening in the reverse order they were initialized in.
98
+
99
+
100
+
101
+
Trivial/Internal Changes
102
+
------------------------
103
+
104
+
- `#12069 <https://github.com/pytest-dev/pytest/issues/12069>`_: ``pluggy>=1.5.0`` is now required.
105
+
106
+
107
+
- `#12167 <https://github.com/pytest-dev/pytest/issues/12167>`_: cache: create cache directory supporting files (``CACHEDIR.TAG``, ``.gitignore``, etc.) in a temporary directory to provide atomic semantics.
0 commit comments