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