mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
freezegun: Fix __exit__ and remove union return types (#4491)
These caused false positives, for example in code like this:
```
with freeze_time(None) as ft: # False positive here
ft.tick(3) # False positive here
```
This commit is contained in:
8
third_party/3/freezegun/api.pyi
vendored
8
third_party/3/freezegun/api.pyi
vendored
@@ -1,6 +1,6 @@
|
||||
from datetime import date, datetime, timedelta
|
||||
from numbers import Real
|
||||
from typing import Awaitable, Callable, Iterator, Optional, Sequence, Type, TypeVar, Union, overload
|
||||
from typing import Any, Awaitable, Callable, Iterator, Optional, Sequence, Type, TypeVar, Union, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_Freezable = Union[str, datetime, date, timedelta]
|
||||
@@ -38,9 +38,9 @@ class _freeze_time:
|
||||
def __call__(self, func: Callable[..., Awaitable[_T]]) -> Callable[..., Awaitable[_T]]: ...
|
||||
@overload
|
||||
def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def __enter__(self) -> Union[StepTickTimeFactory, TickingDateTimeFactory, FrozenDateTimeFactory]: ...
|
||||
def __exit__(self) -> None: ...
|
||||
def start(self) -> Union[StepTickTimeFactory, TickingDateTimeFactory, FrozenDateTimeFactory]: ...
|
||||
def __enter__(self) -> Any: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
def start(self) -> Any: ...
|
||||
def stop(self) -> None: ...
|
||||
def decorate_class(self, klass: Type[_T]) -> _T: ...
|
||||
def decorate_coroutine(self, coroutine: _T) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user