diff --git a/src/xdoctest/__main__.pyi b/src/xdoctest/__main__.pyi index af9cafae..419f63f6 100644 --- a/src/xdoctest/__main__.pyi +++ b/src/xdoctest/__main__.pyi @@ -1,6 +1,8 @@ from typing import Union from typing import List +__tests__: str + def main(argv: Union[List[str], None] = None): ... diff --git a/src/xdoctest/constants.pyi b/src/xdoctest/constants.pyi index 561290a0..a7ba3d95 100644 --- a/src/xdoctest/constants.pyi +++ b/src/xdoctest/constants.pyi @@ -24,4 +24,4 @@ class _NOT_EVAL_TYPE: __nonzero__: Incomplete -NOT_EVALED: Incomplete +NOT_EVALED: _NOT_EVAL_TYPE diff --git a/src/xdoctest/runner.pyi b/src/xdoctest/runner.pyi index 44ea3ac3..617d50fd 100644 --- a/src/xdoctest/runner.pyi +++ b/src/xdoctest/runner.pyi @@ -4,9 +4,11 @@ from types import ModuleType from typing import List from typing import Dict from typing import Any +from typing import Set +from _typeshed import Incomplete -def log(msg: str, verbose: int) -> None: +def log(msg: str, verbose: int, level: int = 1) -> None: ... @@ -14,13 +16,24 @@ def doctest_callable(func: Callable) -> None: ... +def gather_doctests(doctest_identifiers, + style: str = ..., + analysis: str = ..., + verbose: Incomplete | None = ...) -> None: + ... + + def doctest_module(module_identifier: Union[str, ModuleType, None] = None, command: str = None, argv: Union[List[str], None] = None, exclude: List[str] = ..., - style: str = ..., + style: str = 'auto', verbose: Union[int, None] = None, config: Dict[str, object] = None, durations: Union[int, None] = None, analysis: str = 'auto') -> Dict[str, Any]: ... + + +def undefined_names(sourcecode: str) -> Set[str]: + ... diff --git a/src/xdoctest/static_analysis.pyi b/src/xdoctest/static_analysis.pyi index c4903ddc..ef72bf7f 100644 --- a/src/xdoctest/static_analysis.pyi +++ b/src/xdoctest/static_analysis.pyi @@ -81,7 +81,9 @@ def parse_calldefs(source: Incomplete | None = ..., ... -def parse_static_value(key: str, source: str = None, fpath: str = None): +def parse_static_value(key: str, + source: str = None, + fpath: str = None) -> object: ... @@ -101,7 +103,8 @@ def is_balanced_statement(lines: List[str], ... -def extract_comments(source: str) -> Generator[Any, None, Any]: +def extract_comments( + source: Union[str, List[str]]) -> Generator[Any, None, Any]: ... diff --git a/src/xdoctest/utils/util_import.pyi b/src/xdoctest/utils/util_import.pyi index 2080b71d..497720ce 100644 --- a/src/xdoctest/utils/util_import.pyi +++ b/src/xdoctest/utils/util_import.pyi @@ -1,5 +1,8 @@ +from typing import Union from os import PathLike from types import ModuleType +from typing import List +from typing import Tuple from _typeshed import Incomplete @@ -23,7 +26,8 @@ class PythonPathContext: ... -def import_module_from_path(modpath: PathLike, index: int = ...) -> ModuleType: +def import_module_from_path(modpath: Union[str, PathLike], + index: int = ...) -> ModuleType: ... @@ -31,16 +35,18 @@ def import_module_from_name(modname: str) -> ModuleType: ... -def modname_to_modpath(modname: str, - hide_init: bool = True, - hide_main: bool = False, - sys_path: list = None) -> str: +def modname_to_modpath( + modname: str, + hide_init: bool = True, + hide_main: bool = False, + sys_path: Union[None, List[Union[str, + PathLike]]] = None) -> str | None: ... -def normalize_modpath(modpath: PathLike, +def normalize_modpath(modpath: Union[str, PathLike], hide_init: bool = True, - hide_main: bool = False) -> PathLike: + hide_main: bool = False) -> str | PathLike: ... @@ -52,5 +58,5 @@ def modpath_to_modname(modpath: str, ... -def split_modpath(modpath: str, check: bool = True) -> tuple: +def split_modpath(modpath: str, check: bool = True) -> Tuple[str, str]: ...