Tests for stubs. Verify that various things in stubs are consistent with how things behave at runtime.
Class |
|
No class docstring; 0/7 instance variable, 4/4 methods documented |
Class |
|
Marker object for things that are missing (from a stub or the runtime). |
Class |
|
No class docstring; 0/4 instance variable, 0/2 method, 1/3 static method documented |
Exception |
|
Undocumented |
Function | build |
Uses mypy to construct stub objects for the given modules. |
Function | get |
Undocumented |
Function | get |
Returns a mypy type object representing the type of ``runtime``. |
Function | get |
Returns a stub object for the given module, if we've built one. |
Function | get |
Returns a list of stdlib modules in typeshed (for current Python version). |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Checks whether ``left`` is a subtype of ``right``. |
Function | main |
Undocumented |
Function | maybe |
Undocumented |
Function | parse |
Undocumented |
Function | safe |
Undocumented |
Function | silent |
Undocumented |
Function | test |
Tests a given module's stub against introspecting it at runtime. |
Function | test |
This is stubtest! It's time to test the stubs! |
Function | verify |
Entry point for comparing a stub to a runtime object. |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Function | verify |
Undocumented |
Constant | IGNORABLE |
Undocumented |
Constant | IGNORED |
Undocumented |
Constant | MISSING |
Undocumented |
Type Variable | T |
Undocumented |
Type Alias |
|
Undocumented |
Class | _ |
Undocumented |
Function | _get |
Retrieve the names in the global namespace which are known to be imported. |
Function | _resolve |
Returns a FuncItem that corresponds to the output of the decorator. |
Function | _style |
Wrapper around mypy.util for fancy formatting. |
Function | _truncate |
Undocumented |
Function | _verify |
Undocumented |
Function | _verify |
Checks whether argument default values are compatible. |
Function | _verify |
Checks whether argument names match. |
Function | _verify |
Undocumented |
Function | _verify |
Undocumented |
Function | _verify |
Undocumented |
Function | _verify |
Undocumented |
Function | _verify |
Undocumented |
Function | _verify |
Undocumented |
Constant | _formatter |
Undocumented |
Variable | _all |
Undocumented |
list[ str]
, options: Options
, find_submodules: bool
= False) -> list[ str]
:
(source)
¶
Uses mypy to construct stub objects for the given modules. This sets global state that ``get_stub`` can access. Returns all modules we might want to check. If ``find_submodules`` is False, this is equal to ``modules``. :param modules: List of modules to build stubs for. :param options: Mypy options for finding and building stubs. :param find_submodules: Whether to attempt to find submodules of the given modules as well.
Returns a mypy type object representing the type of ``runtime``. Returns None if we can't find something that works.
str|None
, version_info: tuple[ int, int]|None
= None) -> list[ str]
:
(source)
¶
Returns a list of stdlib modules in typeshed (for current Python version).
Tests a given module's stub against introspecting it at runtime. Requires the stub to have been built already, accomplished by a call to ``build_stubs``. :param module_name: The module to test
def verify(stub:
MaybeMissing[ nodes.Node]
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Entry point for comparing a stub to a runtime object. We use single dispatch based on the type of ``stub``. :param stub: The mypy node representing a part of the stub :param runtime: The runtime object corresponding to ``stub``
def verify_decorator(stub:
nodes.Decorator
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_funcitem(stub:
nodes.FuncItem
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_mypyfile(stub:
nodes.MypyFile
, runtime: MaybeMissing[ types.ModuleType]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_none(stub:
Missing
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_overloadedfuncdef(stub:
nodes.OverloadedFuncDef
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_paramspecexpr(stub:
nodes.ParamSpecExpr
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_typealias(stub:
nodes.TypeAlias
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_typeinfo(stub:
nodes.TypeInfo
, runtime: MaybeMissing[ type[ Any]]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_typevarexpr(stub:
nodes.TypeVarExpr
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
def verify_var(stub:
nodes.Var
, runtime: MaybeMissing[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
Undocumented
Value |
|
Undocumented
Value |
|
Retrieve the names in the global namespace which are known to be imported. 1). Use inspect to retrieve the source code of the module 2). Use symtable to parse the source and retrieve names that are known to be imported from other modules. If either of the above steps fails, return `None`. Note that if a set of names is returned, it won't include names imported via `from foo import *` imports.
Returns a FuncItem that corresponds to the output of the decorator. Returns None if we can't figure out what that would be. For convenience, this function also accepts FuncItems.
nodes.Argument
, runtime_arg: inspect.Parameter
) -> Iterator[ str]
:
(source)
¶
Checks whether argument default values are compatible.
nodes.Argument
, runtime_arg: inspect.Parameter
, function_name: str
) -> Iterator[ str]
:
(source)
¶
Checks whether argument names match.
list[ str]
, stub: nodes.MypyFile
, runtime_all_as_set: set[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
nodes.TypeInfo
, runtime: type[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
nodes.TypeInfo
, runtime: type[ Any]
, object_path: list[ str]
) -> Iterator[ Error]
:
(source)
¶
Undocumented
Signature[ nodes.Argument]
, runtime: Signature[ inspect.Parameter]
, function_name: str
) -> Iterator[ str]
:
(source)
¶
Undocumented