From d2f9a73a299c0c15280e072c9b3183870e0b1e4b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 25 Feb 2020 02:15:26 +0100 Subject: [PATCH] typing: get_dirs_from_args --- src/_pytest/config/findpaths.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index fb84160c1..d63071084 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -86,14 +86,14 @@ def get_common_ancestor(paths: Iterable[py.path.local]) -> py.path.local: return common_ancestor -def get_dirs_from_args(args): - def is_option(x): - return str(x).startswith("-") +def get_dirs_from_args(args: List[str]) -> List[py.path.local]: + def is_option(x: str) -> bool: + return x.startswith("-") - def get_file_part_from_node_id(x): - return str(x).split("::")[0] + def get_file_part_from_node_id(x: str) -> str: + return x.split("::")[0] - def get_dir_from_path(path): + def get_dir_from_path(path: py.path.local) -> py.path.local: if path.isdir(): return path return py.path.local(path.dirname)