Add explanation

This commit is contained in:
Florian Bruhin 2021-11-29 13:30:11 +01:00
parent 05cf2fdae4
commit aa3c8a1d3c
4 changed files with 18 additions and 2 deletions

View File

@ -5,3 +5,6 @@
.. 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``).
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

@ -8,5 +8,9 @@ The following hooks now receive an additional ``pathlib.Path`` argument, equival
.. 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``).
``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

@ -4,3 +4,6 @@ due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`, w
.. note::
The name of the attributes (old ``fspath``, new ``path``) is **the opposite**
of the situation for hooks.
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

@ -59,6 +59,9 @@ Plugins which implement custom items and collectors are encouraged to replace
.. 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>`.
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).
Due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`
which still is expected to return a ``py.path.local`` object, nodes still have
@ -86,6 +89,9 @@ The accompanying ``py.path.local`` based paths have been deprecated: plugins whi
.. 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>`.
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).
Directly constructing internal classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~