Skip to content

Commit

Permalink
Fix type hint of Mocker.__enter__/__exit__
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos authored and jamielennox committed Apr 18, 2024
1 parent fba8cc7 commit c42ab56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions requests_mock/mocker.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from json import JSONEncoder
from http.cookiejar import CookieJar
from io import IOBase
from types import TracebackType
from typing import Any, Callable, Dict, List, Optional, Pattern, Type, TypeVar, Union, overload

from requests import Response, Session
from typing_extensions import Self
from urllib3.response import HTTPResponse

from requests_mock.adapter import AnyMatcher, _Matcher, Callback, AdditionalMatcher
Expand Down Expand Up @@ -255,8 +257,8 @@ class Mocker(MockerCore):
real_http: bool = ...,
json_encoder: Optional[Type[JSONEncoder]] = ...,
) -> None: ...
def __enter__(self) -> Any: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None) -> None: ...
@overload
def __call__(self, obj: type[_T]) -> type[_T]: ...
@overload
Expand Down

0 comments on commit c42ab56

Please sign in to comment.