Add test to import all modules to check validity of stubs (#56)

* add import_all.test builder

* fix errors

* fix typechecking errors

* fix migrations typechecking
This commit is contained in:
Maxim Kurnikov
2019-03-25 01:57:34 +03:00
committed by GitHub
parent 5d0ee40ada
commit 5c6be7ad12
79 changed files with 706 additions and 1155 deletions

View File

@@ -1,5 +1,5 @@
from enum import Enum
from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, Type, Union
from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, Union
from django.http.request import HttpRequest
from django.template.context import Context as Context
@@ -126,12 +126,12 @@ filter_re: Any
class FilterExpression:
token: str = ...
filters: List[Tuple[Callable, List[Tuple[bool, Union[Variable, SafeText]]]]] = ...
var: Union[Variable, SafeText] = ...
filters: List[Any] = ...
var: Any = ...
def __init__(self, token: str, parser: Parser) -> None: ...
def resolve(self, context: Union[Dict[str, Dict[str, str]], Context], ignore_failures: bool = ...) -> Any: ...
def resolve(self, context: Mapping[str, Any], ignore_failures: bool = ...) -> Any: ...
@staticmethod
def args_check(name: str, func: Callable, provided: List[Tuple[bool, Union[Variable, SafeText]]]) -> bool: ...
def args_check(name: str, func: Callable, provided: List[Tuple[bool, Any]]) -> bool: ...
class Variable:
var: Union[Dict[Any, Any], str] = ...
@@ -152,27 +152,21 @@ class Node:
def __iter__(self) -> None: ...
def get_nodes_by_type(self, nodetype: Type[Node]) -> List[Node]: ...
class NodeList(list):
class NodeList(List[Node]):
contains_nontext: bool = ...
def render(self, context: Context) -> SafeText: ...
def get_nodes_by_type(self, nodetype: Type[Node]) -> List[Node]: ...
class TextNode(Node):
origin: Origin
token: Token
s: str = ...
def __init__(self, s: str) -> None: ...
def render(self, context: Context) -> str: ...
def render_value_in_context(value: Any, context: Context) -> str: ...
class VariableNode(Node):
origin: Origin
token: Token
filter_expression: FilterExpression = ...
def __init__(self, filter_expression: FilterExpression) -> None: ...
def render(self, context: Context) -> str: ...
kwarg_re: Any
def token_kwargs(bits: List[str], parser: Parser, support_legacy: bool = ...) -> Dict[str, FilterExpression]: ...
def token_kwargs(bits: Sequence[str], parser: Parser, support_legacy: bool = ...) -> Dict[str, FilterExpression]: ...