Move Node.fspath to legacypath plugin

This commit is contained in:
Ran Benita
2021-10-16 11:27:38 +03:00
parent ce7cff9f8e
commit c3dff755af
3 changed files with 25 additions and 10 deletions

View File

@@ -24,7 +24,6 @@ from _pytest._code.code import ExceptionInfo
from _pytest._code.code import TerminalRepr
from _pytest.compat import cached_property
from _pytest.compat import LEGACY_PATH
from _pytest.compat import legacy_path
from _pytest.config import Config
from _pytest.config import ConftestImportFailure
from _pytest.deprecated import FSCOLLECTOR_GETHOOKPROXY_ISINITPATH
@@ -238,15 +237,6 @@ class Node(metaclass=NodeMeta):
# Deprecated alias. Was never public. Can be removed in a few releases.
self._store = self.stash
@property
def fspath(self) -> LEGACY_PATH:
"""(deprecated) returns a legacy_path copy of self.path"""
return legacy_path(self.path)
@fspath.setter
def fspath(self, value: LEGACY_PATH) -> None:
self.path = Path(value)
@classmethod
def from_parent(cls, parent: "Node", **kw):
"""Public constructor for Nodes.