Skip to content

Commit

Permalink
feat: patch, post, put return type
Browse files Browse the repository at this point in the history
Co-authored-by: Oscar Butler-Aldridge <oscarb@protonmail.com>
  • Loading branch information
tdadela and 0scarB authored Jun 23, 2024
1 parent e489d9b commit 472d597
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions locust/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ def head(self, url: str | bytes, **kwargs: Unpack[RESTKwargs]): # type: ignore[

# These # type: ignore[misc] comments below are needed because data and json parameters are already defined in the
# RESTKwargs TypedDict. An alternative approach is to define another TypedDict which doesn't contain them.
def post(self, url: str | bytes, data: Any | None = None, json: Any | None = None, **kwargs: Unpack[RESTKwargs]): # type: ignore[override, misc]
def post(self, url: str | bytes, data: Any | None = None, json: Any | None = None, **kwargs: Unpack[RESTKwargs]) -> (ResponseContextManager | Response | LocustResponse): # type: ignore[override, misc]
return self.request("POST", url, data=data, json=json, **kwargs) # type: ignore[misc]

def put(self, url: str | bytes, data: Any | None = None, **kwargs: Unpack[RESTKwargs]): # type: ignore[override, misc]
def put(self, url: str | bytes, data: Any | None = None, **kwargs: Unpack[RESTKwargs]) -> (ResponseContextManager | Response | LocustResponse): # type: ignore[override, misc]
return self.request("PUT", url, data=data, **kwargs) # type: ignore[misc]

def patch(self, url: str | bytes, data: Any | None = None, **kwargs: Unpack[RESTKwargs]): # type: ignore[override, misc]
def patch(self, url: str | bytes, data: Any | None = None, **kwargs: Unpack[RESTKwargs]) -> (ResponseContextManager | Response | LocustResponse): # type: ignore[override, misc]
return self.request("PATCH", url, data=data, **kwargs) # type: ignore[misc]

def delete(self, url: str | bytes, **kwargs: Unpack[RESTKwargs]): # type: ignore[override]
Expand Down

0 comments on commit 472d597

Please sign in to comment.