Open smessmer opened 8 years ago
Could you add type hints or type stubs to nose? I created some own type stubs for it in my project and appended them below, maybe they help:
tools.pyi:
import sys from typing import TypeVar, Iterable, Any, Type, Callable, Dict, Sequence, List, Tuple, Set T = TypeVar('T') U = TypeVar('U') def assert_equal(first: T, second: T, msg: str = None) -> None: ... def assert_not_equal(first: T, second: T, msg: str = None) -> None: ... def assert_true(expr: bool, msg: str = None) -> None: ... def assert_false(expr: bool, msg: str = None) -> None: ... if sys.version_info >= (2, 7): def assert_is(expr1: T, expr2: T, msg: str = None) -> None: ... def assert_is_not(expr1: T, expr2: T, msg: str = None) -> None: ... def assert_is_none(obj: T, msg: str = None) -> None: ... def assert_is_not_none(obj: T, msg: str = None) -> None: ... def assert_in(member: T, container: Iterable[T], msg: str = None) -> None: ... def assert_not_in(member: T, container: Iterable[T], msg: str = None) -> None: ... def assert_is_instance(obj: Any, cls: Type, msg: str = None) -> None: ... def assert_not_is_instance(obj: Any, cls: Type, msg: str = None) -> None: ... def assert_raises(excClass: Any, callableObj: Callable[...,None] = None, *args: Any, **kwargs: Any) -> None: ... if sys.version_info >= (2, 7): def assert_raises_regexp(expected_exception: Any, expected_regexp: str, callable_obj: Callable[...,None] = None, *args: Any, **kwargs: Any) -> None: ... def assert_almost_equal(first: float, second: float, places: int = None, msg: str = None, delta: float = None) -> None: ... def assert_not_almost_equal(first: float, second: float, places: int = None, msg: str = None, delta: float = None) -> None: ... Numeric = TypeVar('Numeric', int, float) TupleType = TypeVar('TupleType', bound=Tuple) if sys.version_info >= (2, 7): def assert_greater(a: Numeric, b: Numeric, msg: str = None) -> None: ... def assert_greater_equal(a: Numeric, b: Numeric, msg: str = None) -> None: ... def assert_less(a: Numeric, b: Numeric, msg: str = None) -> None: ... def assert_less_equal(a: Numeric, b: Numeric, msg: str = None) -> None: ... def assert_regexp_matches(text: str, expected_regexp: str, msg: str = None) -> None: ... def assert_not_regexp_matches(text: str, unexpected_regexp: str, msg: str = None) -> None: ... def assert_items_equal(expected_seq: Iterable[T], actual_seq: Iterable[T], msg: str = None) -> None: ... def assert_dict_contains_subset(expected: Dict[T, U], actual: Dict[T, U], msg: str = None) -> None: ... def assert_multi_line_equal(first: str, second: str, msg: str = None) -> None: ... def assert_sequence_equal(seq1: Sequence[T], seq2: Sequence[T], msg: str = None, seq_type: Type = None) -> None: ... def assert_list_equal(list1: List[T], list2: List[T], msg: str = None) -> None: ... def assert_tuple_equal(tuple1: TupleType, tuple2: TupleType, msg: str = None) -> None: ... def assert_set_equal(set1: Set[T], set2: Set[T], msg: str = None) -> None: ... def assert_dict_equal(d1: Dict[T, U], d2: Dict[T, U], msg: str = None) -> None: ... assert_equals = assert_equal assert_not_equals = assert_not_equal assert_almost_equals = assert_almost_equal assert_not_almost_equals = assert_not_almost_equal
Could you add type hints or type stubs to nose? I created some own type stubs for it in my project and appended them below, maybe they help:
tools.pyi: