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
Delayed the deprecation of the following features to ``9.0.0``:
2
+
3
+
* :ref:`node-ctor-fspath-deprecation`.
4
+
* :ref:`legacy-path-hooks-deprecated`.
5
+
6
+
It was discovered after ``8.1.0`` was released that the warnings about the impeding removal were not being displayed, so the team decided to revert the removal.
In order to support the transition from ``py.path.local`` to :mod:`pathlib`, the following hooks now receive additional arguments:
111
+
112
+
* :hook:`pytest_ignore_collect(collection_path: pathlib.Path) <pytest_ignore_collect>` as equivalent to ``path``
113
+
* :hook:`pytest_collect_file(file_path: pathlib.Path) <pytest_collect_file>` as equivalent to ``path``
114
+
* :hook:`pytest_pycollect_makemodule(module_path: pathlib.Path) <pytest_pycollect_makemodule>` as equivalent to ``path``
115
+
* :hook:`pytest_report_header(start_path: pathlib.Path) <pytest_report_header>` as equivalent to ``startdir``
116
+
* :hook:`pytest_report_collectionfinish(start_path: pathlib.Path) <pytest_report_collectionfinish>` as equivalent to ``startdir``
117
+
118
+
The accompanying ``py.path.local`` based paths have been deprecated: plugins which manually invoke those hooks should only pass the new ``pathlib.Path`` arguments, and users should change their hook implementations to use the new ``pathlib.Path`` arguments.
119
+
120
+
.. note::
121
+
The name of the :class:`~_pytest.nodes.Node` arguments and attributes,
122
+
:ref:`outlined above <node-ctor-fspath-deprecation>` (the new attribute
123
+
being ``path``) is **the opposite** of the situation for hooks (the old
124
+
argument being ``path``).
125
+
126
+
This is an unfortunate artifact due to historical reasons, which should be
127
+
resolved in future versions as we slowly get rid of the :pypi:`py`
128
+
dependency (see :issue:`9283` for a longer discussion).
129
+
65
130
Directly constructing internal classes
66
131
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67
132
@@ -208,73 +273,6 @@ an appropriate period of deprecation has passed.
208
273
209
274
Some breaking changes which could not be deprecated are also listed.
210
275
211
-
.. _node-ctor-fspath-deprecation:
212
-
213
-
``fspath`` argument for Node constructors replaced with ``pathlib.Path``
In order to support the transition from ``py.path.local`` to :mod:`pathlib`, the following hooks now receive additional arguments:
258
-
259
-
* :hook:`pytest_ignore_collect(collection_path: pathlib.Path) <pytest_ignore_collect>` as equivalent to ``path``
260
-
* :hook:`pytest_collect_file(file_path: pathlib.Path) <pytest_collect_file>` as equivalent to ``path``
261
-
* :hook:`pytest_pycollect_makemodule(module_path: pathlib.Path) <pytest_pycollect_makemodule>` as equivalent to ``path``
262
-
* :hook:`pytest_report_header(start_path: pathlib.Path) <pytest_report_header>` as equivalent to ``startdir``
263
-
* :hook:`pytest_report_collectionfinish(start_path: pathlib.Path) <pytest_report_collectionfinish>` as equivalent to ``startdir``
264
-
265
-
The accompanying ``py.path.local`` based paths have been deprecated: plugins which manually invoke those hooks should only pass the new ``pathlib.Path`` arguments, and users should change their hook implementations to use the new ``pathlib.Path`` arguments.
266
-
267
-
.. note::
268
-
The name of the :class:`~_pytest.nodes.Node` arguments and attributes,
269
-
:ref:`outlined above <node-ctor-fspath-deprecation>` (the new attribute
270
-
being ``path``) is **the opposite** of the situation for hooks (the old
271
-
argument being ``path``).
272
-
273
-
This is an unfortunate artifact due to historical reasons, which should be
274
-
resolved in future versions as we slowly get rid of the :pypi:`py`
275
-
dependency (see :issue:`9283` for a longer discussion).
0 commit comments