Skip to content

Commit a02cc0a

Browse files
committed
Add types
1 parent 74f0564 commit a02cc0a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

testing/test_cacheprovider.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# mypy: allow-untyped-defs
21
import os
32
from pathlib import Path
43
import shutil
4+
from typing import Any
55
from typing import Generator
66
from typing import List
7+
from typing import Sequence
8+
from typing import Tuple
79

810
from _pytest.config import ExitCode
911
from _pytest.monkeypatch import MonkeyPatch
@@ -175,7 +177,9 @@ def test_custom_cache_dir_with_env_var(
175177

176178

177179
@pytest.mark.parametrize("env", ((), ("TOX_ENV_DIR", "/tox_env_dir")))
178-
def test_cache_reportheader(env, pytester: Pytester, monkeypatch: MonkeyPatch) -> None:
180+
def test_cache_reportheader(
181+
env: Sequence[str], pytester: Pytester, monkeypatch: MonkeyPatch
182+
) -> None:
179183
pytester.makepyfile("""def test_foo(): pass""")
180184
if env:
181185
monkeypatch.setenv(*env)
@@ -507,7 +511,7 @@ def test_hello():
507511
"""
508512
)
509513

510-
def rlf(fail_import, fail_run):
514+
def rlf(fail_import: int, fail_run: int) -> Any:
511515
monkeypatch.setenv("FAILIMPORT", str(fail_import))
512516
monkeypatch.setenv("FAILTEST", str(fail_run))
513517

@@ -555,7 +559,9 @@ def test_pass():
555559
"""
556560
)
557561

558-
def rlf(fail_import, fail_run, args=()):
562+
def rlf(
563+
fail_import: int, fail_run: int, args: Sequence[str] = ()
564+
) -> Tuple[Any, Any]:
559565
monkeypatch.setenv("FAILIMPORT", str(fail_import))
560566
monkeypatch.setenv("FAILTEST", str(fail_run))
561567

0 commit comments

Comments
 (0)