Add member vars of retention options to TempPathFactory class
This commit is contained in:
parent
92eb443842
commit
7f80cc15b3
|
@ -31,10 +31,14 @@ class TempPathFactory:
|
||||||
_given_basetemp = attr.ib(type=Optional[Path])
|
_given_basetemp = attr.ib(type=Optional[Path])
|
||||||
_trace = attr.ib()
|
_trace = attr.ib()
|
||||||
_basetemp = attr.ib(type=Optional[Path])
|
_basetemp = attr.ib(type=Optional[Path])
|
||||||
|
_retention_count = attr.ib(type=Optional[int])
|
||||||
|
_retention_policy = attr.ib(type=Optional[str])
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
given_basetemp: Optional[Path],
|
given_basetemp: Optional[Path],
|
||||||
|
retention_count: Optional[int],
|
||||||
|
retention_policy: Optional[str],
|
||||||
trace,
|
trace,
|
||||||
basetemp: Optional[Path] = None,
|
basetemp: Optional[Path] = None,
|
||||||
*,
|
*,
|
||||||
|
@ -49,6 +53,8 @@ class TempPathFactory:
|
||||||
# Path.absolute() exists, but it is not public (see https://bugs.python.org/issue25012).
|
# Path.absolute() exists, but it is not public (see https://bugs.python.org/issue25012).
|
||||||
self._given_basetemp = Path(os.path.abspath(str(given_basetemp)))
|
self._given_basetemp = Path(os.path.abspath(str(given_basetemp)))
|
||||||
self._trace = trace
|
self._trace = trace
|
||||||
|
self._retention_count = retention_count
|
||||||
|
self._retention_policy = retention_policy
|
||||||
self._basetemp = basetemp
|
self._basetemp = basetemp
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -66,6 +72,8 @@ class TempPathFactory:
|
||||||
return cls(
|
return cls(
|
||||||
given_basetemp=config.option.basetemp,
|
given_basetemp=config.option.basetemp,
|
||||||
trace=config.trace.get("tmpdir"),
|
trace=config.trace.get("tmpdir"),
|
||||||
|
retention_count=config.option.tmp_path_retention_count,
|
||||||
|
retention_policy=config.option.tmp_path_retention_policy,
|
||||||
_ispytest=True,
|
_ispytest=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue