test: use builtins for type annotations instead of List / Optional

This commit is contained in:
Jörg Thalheim 2023-11-29 08:16:00 +01:00
parent 26b7fce564
commit 9ac34be48f
2 changed files with 6 additions and 7 deletions

View file

@ -1,19 +1,19 @@
import subprocess
from pathlib import Path
from typing import IO, Any, List, Optional, Union
from typing import IO, Any
_FILE = Union[None, int, IO[Any]]
_DIR = Union[None, Path, str]
_FILE = None | int | IO[Any]
_DIR = None | Path | str
def run(
cmd: List[str],
cmd: list[str],
text: bool = True,
check: bool = True,
cwd: _DIR = None,
stderr: _FILE = None,
stdout: _FILE = None,
env: Optional[dict[str, str]] = None,
env: dict[str, str] | None = None,
) -> subprocess.CompletedProcess:
if cwd is not None:
print(f"cd {cwd}")