From cfcaac5a87965bf05b48b6286e628df16ed10e92 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:53:35 -0400 Subject: [PATCH] _pytest._py.path: remove decorator compat --- src/_pytest/_py/path.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 93f5528529a..f51e574cef0 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -119,30 +119,26 @@ def __div__(self, other): __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 @@ def sysexec(self, *argv, **popen_opts): ) 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 @@ def sysfind(cls, name, checker=None, paths=None): pass return None - sysfind = classmethod(sysfind) - + @classmethod def _gethomedir(cls): try: x = os.environ["HOME"] @@ -1263,8 +1259,6 @@ def _gethomedir(cls): return None return cls(x) - _gethomedir = classmethod(_gethomedir) - # """ # special class constructors for local filesystem paths # """ @@ -1288,6 +1282,7 @@ def mkdtemp(cls, rootdir=None): 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 @@ def is_garbage(path): return udir - make_numbered_dir = classmethod(make_numbered_dir) - def copymode(src, dest): """copy permission from src to dst."""