Update wording after #9363

This commit is contained in:
Florian Bruhin 2021-12-03 14:48:29 +01:00
parent aa3c8a1d3c
commit 69659a92a6
4 changed files with 21 additions and 11 deletions

View File

@ -3,8 +3,10 @@
``py.path.local`` arguments to Node constructors have been deprecated. See :ref:`the deprecation note <node-ctor-fspath-deprecation>` for full details.
.. note::
The name of the ``Node`` arguments and attributes (old ``fspath``, new ``path``) is **the opposite**
of the situation for hooks (old ``path``, new ``fspath``).
The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the
new attribute being ``path``) is **the opposite** of the situation for hooks
(the old argument being ``path``).
This is an unfortunate artifact due to historical reasons, which should be
resolved in future versions as we slowly get rid of the :pypi:`py`
dependency (see :issue:`9283` for a longer discussion).

View File

@ -7,9 +7,9 @@ The following hooks now receive an additional ``pathlib.Path`` argument, equival
- :func:`pytest_report_collectionfinish <_pytest.hookspec.pytest_report_collectionfinish>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter).
.. note::
The name of the ``Node`` arguments and attributes (the new attribute being
``path``) is **the opposite** of the situation for hooks (the old argument
being ``path``).
The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the
new attribute being ``path``) is **the opposite** of the situation for hooks
(the old argument being ``path``).
This is an unfortunate artifact due to historical reasons, which should be
resolved in future versions as we slowly get rid of the :pypi:`py`

View File

@ -2,8 +2,10 @@ Implement ``Node.path`` as a ``pathlib.Path``. Both the old ``fspath`` and this
due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`, we expect to deprecate it in a future release.
.. note::
The name of the attributes (old ``fspath``, new ``path``) is **the opposite**
of the situation for hooks.
The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the
new attribute being ``path``) is **the opposite** of the situation for hooks
(the old argument being ``path``).
This is an unfortunate artifact due to historical reasons, which should be
resolved in future versions as we slowly get rid of the :pypi:`py`
dependency (see :issue:`9283` for a longer discussion).

View File

@ -57,8 +57,11 @@ Plugins which implement custom items and collectors are encouraged to replace
(``pathlib.Path``), and drop any other usage of the ``py`` library if possible.
.. note::
The name of the arguments (old ``fspath``, new ``path``) is **the opposite**
of the situation for hooks, :ref:`outlined below <legacy-path-hooks-deprecated>`.
The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the
new attribute being ``path``) is **the opposite** of the situation for
hooks, :ref:`outlined below <legacy-path-hooks-deprecated>` (the old
argument being ``path``).
This is an unfortunate artifact due to historical reasons, which should be
resolved in future versions as we slowly get rid of the :pypi:`py`
dependency (see :issue:`9283` for a longer discussion).
@ -87,8 +90,11 @@ In order to support the transition from ``py.path.local`` to :mod:`pathlib`, the
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.
.. note::
The name of the arguments (old ``path``, new ``fspath``) is **the opposite**
of the situation for the :class:`~_pytest.nodes.Node` class, :ref:`outlined above <node-ctor-fspath-deprecation>`.
The name of the :class:`~_pytest.nodes.Node` arguments and attributes,
:ref:`outlined above <node-ctor-fspath-deprecation>` (the new attribute
being ``path``) is **the opposite** of the situation for hooks (the old
argument being ``path``).
This is an unfortunate artifact due to historical reasons, which should be
resolved in future versions as we slowly get rid of the :pypi:`py`
dependency (see :issue:`9283` for a longer discussion).