Skip to content

Commit

Permalink
chain
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jul 15, 2023
1 parent ff2f536 commit a2f8dbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions httpx/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def has_redirect_location(self) -> bool:
and "Location" in self.headers
)

def raise_for_status(self) -> None:
def raise_for_status(self) -> 'Response':
"""
Raise the `HTTPStatusError` if one occurred.
"""
Expand All @@ -723,7 +723,7 @@ def raise_for_status(self) -> None:
)

if self.is_success:
return
return self

if self.has_redirect_location:
message = (
Expand Down
2 changes: 1 addition & 1 deletion tests/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_raise_for_status(server):
assert exc_info.value.response == response
assert exc_info.value.request.url.path == f"/status/{status_code}"
else:
assert response.raise_for_status() is None # type: ignore
assert response.raise_for_status() is response # type: ignore


def test_options(server):
Expand Down

0 comments on commit a2f8dbe

Please sign in to comment.