Fix Literal for older version
This commit is contained in:
parent
0eb8723199
commit
557c7ce0bf
|
@ -13,6 +13,8 @@ from typing import Union
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing_extensions import Literal
|
from typing_extensions import Literal
|
||||||
|
|
||||||
|
RetentionType = Literal["all", "failed", "none"]
|
||||||
|
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from _pytest.config.argparsing import Parser
|
from _pytest.config.argparsing import Parser
|
||||||
|
@ -45,13 +47,13 @@ class TempPathFactory:
|
||||||
_trace = attr.ib()
|
_trace = attr.ib()
|
||||||
_basetemp = attr.ib(type=Optional[Path])
|
_basetemp = attr.ib(type=Optional[Path])
|
||||||
_retention_count = attr.ib(type=int)
|
_retention_count = attr.ib(type=int)
|
||||||
_retention_policy = attr.ib(type=RetentionPolicy)
|
_retention_policy = attr.ib(type="RetentionType")
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
given_basetemp: Optional[Path],
|
given_basetemp: Optional[Path],
|
||||||
retention_count: int,
|
retention_count: int,
|
||||||
retention_policy: RetentionPolicy,
|
retention_policy: "RetentionType",
|
||||||
trace,
|
trace,
|
||||||
basetemp: Optional[Path] = None,
|
basetemp: Optional[Path] = None,
|
||||||
*,
|
*,
|
||||||
|
|
Loading…
Reference in New Issue