Add types

This commit is contained in:
Tamir Duberstein 2024-04-08 14:59:51 +01:00
parent 74f05648d5
commit a02cc0ad1b
No known key found for this signature in database
1 changed files with 10 additions and 4 deletions

View File

@ -1,9 +1,11 @@
# mypy: allow-untyped-defs
import os import os
from pathlib import Path from pathlib import Path
import shutil import shutil
from typing import Any
from typing import Generator from typing import Generator
from typing import List from typing import List
from typing import Sequence
from typing import Tuple
from _pytest.config import ExitCode from _pytest.config import ExitCode
from _pytest.monkeypatch import MonkeyPatch from _pytest.monkeypatch import MonkeyPatch
@ -175,7 +177,9 @@ class TestNewAPI:
@pytest.mark.parametrize("env", ((), ("TOX_ENV_DIR", "/tox_env_dir"))) @pytest.mark.parametrize("env", ((), ("TOX_ENV_DIR", "/tox_env_dir")))
def test_cache_reportheader(env, pytester: Pytester, monkeypatch: MonkeyPatch) -> None: def test_cache_reportheader(
env: Sequence[str], pytester: Pytester, monkeypatch: MonkeyPatch
) -> None:
pytester.makepyfile("""def test_foo(): pass""") pytester.makepyfile("""def test_foo(): pass""")
if env: if env:
monkeypatch.setenv(*env) monkeypatch.setenv(*env)
@ -507,7 +511,7 @@ class TestLastFailed:
""" """
) )
def rlf(fail_import, fail_run): def rlf(fail_import: int, fail_run: int) -> Any:
monkeypatch.setenv("FAILIMPORT", str(fail_import)) monkeypatch.setenv("FAILIMPORT", str(fail_import))
monkeypatch.setenv("FAILTEST", str(fail_run)) monkeypatch.setenv("FAILTEST", str(fail_run))
@ -555,7 +559,9 @@ class TestLastFailed:
""" """
) )
def rlf(fail_import, fail_run, args=()): def rlf(
fail_import: int, fail_run: int, args: Sequence[str] = ()
) -> Tuple[Any, Any]:
monkeypatch.setenv("FAILIMPORT", str(fail_import)) monkeypatch.setenv("FAILIMPORT", str(fail_import))
monkeypatch.setenv("FAILTEST", str(fail_run)) monkeypatch.setenv("FAILTEST", str(fail_run))