_pytest._py.path: remove decorator compat

This commit is contained in:
Anthony Sottile 2022-10-19 12:53:35 -04:00
parent 00e2f1c15c
commit 382209d9e9
1 changed files with 7 additions and 14 deletions

View File

@ -119,30 +119,26 @@ class PathBase:
__truediv__ = __div__ # py3k
@property
def basename(self):
"""basename part of path."""
return self._getbyspec("basename")[0]
basename = property(basename, None, None, basename.__doc__)
@property
def dirname(self):
"""dirname part of path."""
return self._getbyspec("dirname")[0]
dirname = property(dirname, None, None, dirname.__doc__)
@property
def purebasename(self):
"""pure base name of the path."""
return self._getbyspec("purebasename")[0]
purebasename = property(purebasename, None, None, purebasename.__doc__)
@property
def ext(self):
"""extension of the path (including the '.')."""
return self._getbyspec("ext")[0]
ext = property(ext, None, None, ext.__doc__)
def dirpath(self, *args, **kwargs):
"""return the directory path joined with any given path arguments."""
return self.new(basename="").join(*args, **kwargs)
@ -1205,6 +1201,7 @@ class LocalPath(FSBase):
)
return stdout
@classmethod
def sysfind(cls, name, checker=None, paths=None):
"""return a path object found by looking at the systems
underlying PATH specification. If the checker is not None
@ -1251,8 +1248,7 @@ class LocalPath(FSBase):
pass
return None
sysfind = classmethod(sysfind)
@classmethod
def _gethomedir(cls):
try:
x = os.environ["HOME"]
@ -1263,8 +1259,6 @@ class LocalPath(FSBase):
return None
return cls(x)
_gethomedir = classmethod(_gethomedir)
# """
# special class constructors for local filesystem paths
# """
@ -1288,6 +1282,7 @@ class LocalPath(FSBase):
rootdir = cls.get_temproot()
return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir)))
@classmethod
def make_numbered_dir(
cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800
): # two days
@ -1449,8 +1444,6 @@ class LocalPath(FSBase):
return udir
make_numbered_dir = classmethod(make_numbered_dir)
def copymode(src, dest):
"""copy permission from src to dst."""