Skip to content

Commit

Permalink
ref: simplify close_streaming_response using .getvalue() (#71160)
Browse files Browse the repository at this point in the history
<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry committed May 20, 2024
1 parent 430df91 commit 194fefd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/sentry/testutils/helpers/response.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

from collections.abc import Iterable

from django.http.response import HttpResponseBase, StreamingHttpResponse


Expand All @@ -12,5 +10,4 @@ def close_streaming_response(response: HttpResponseBase) -> bytes:
avoiding a `ResourceWarning`.
"""
assert isinstance(response, StreamingHttpResponse)
assert isinstance(response.streaming_content, Iterable)
return b"".join(response.streaming_content)
return response.getvalue()

0 comments on commit 194fefd

Please sign in to comment.