Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions openfga_sdk/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,6 @@ async def stream(
# Release the response object (required!)
response.release()

# Release the connection back to the pool
await self.close()

async def request(
self,
method: str,
Expand Down
3 changes: 0 additions & 3 deletions openfga_sdk/sync/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,6 @@ def stream(
# Release the response object (required!)
response.release_conn()

# Release the connection back to the pool
self.close()

def request(
self,
method: str,
Expand Down
3 changes: 0 additions & 3 deletions test/rest_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ async def iter_chunks(self):

client.handle_response_exception.assert_awaited_once()
mock_response.release.assert_called_once()
client.close.assert_awaited_once()


@pytest.mark.asyncio
Expand Down Expand Up @@ -364,7 +363,6 @@ async def iter_chunks(self):
assert results == []
client.handle_response_exception.assert_awaited_once()
mock_response.release.assert_called_once()
client.close.assert_awaited_once()


@pytest.mark.asyncio
Expand Down Expand Up @@ -411,4 +409,3 @@ async def iter_chunks(self):

client.handle_response_exception.assert_awaited_once()
mock_response.release.assert_called_once()
client.close.assert_awaited_once()
6 changes: 1 addition & 5 deletions test/sync/rest_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def test_close():
client.pool_manager = mock_pool_manager

client.close()

mock_pool_manager.clear.assert_called_once()


Expand Down Expand Up @@ -333,7 +334,6 @@ def test_request_preload_content():
assert isinstance(resp, RESTResponse)
assert resp.status == 200
assert resp.data == b'{"some":"data"}'
mock_pool_manager.clear.assert_called_once()


def test_request_no_preload_content():
Expand Down Expand Up @@ -380,7 +380,6 @@ def test_request_no_preload_content():
# We expect the raw HTTPResponse
assert resp == mock_raw_response
assert resp.status == 200
mock_pool_manager.clear.assert_called_once()


def test_stream_happy_path():
Expand Down Expand Up @@ -431,7 +430,6 @@ def release_conn(self):

assert results == [{"foo": "bar"}, {"hello": "world"}]
mock_pool_manager.request.assert_called_once()
mock_pool_manager.clear.assert_called_once()


def test_stream_partial_chunks():
Expand Down Expand Up @@ -483,7 +481,6 @@ def release_conn(self):

assert results == [{"foo": "bar"}, {"hello": "world"}]
mock_pool_manager.request.assert_called_once()
mock_pool_manager.clear.assert_called_once()


def test_stream_exception_in_chunks():
Expand Down Expand Up @@ -534,4 +531,3 @@ def release_conn(self):
# Exception is logged, we yield nothing
assert results == []
mock_pool_manager.request.assert_called_once()
mock_pool_manager.clear.assert_called_once()