Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 68026be

Browse files
committed
fix: try no timeout as fix instead of sleep
1 parent bd2e09c commit 68026be

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

tests/_async/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ async def storage() -> AsyncStorageClient:
3232
"Authorization": f"Bearer {key}",
3333
},
3434
) as client:
35+
client.session.timeout = None
3536
yield client

tests/_async/test_client.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass
4-
from time import sleep
54
from typing import TYPE_CHECKING
65
from uuid import uuid4
76

@@ -168,8 +167,6 @@ async def test_client_upload(
168167
file.bucket_path, file.local_path, {"content-type": file.mime_type}
169168
)
170169

171-
sleep(3)
172-
173170
image = await storage_file_client.download(file.bucket_path)
174171
files = await storage_file_client.list(file.bucket_folder)
175172
image_info = next((f for f in files if f.get("name") == file.name), None)
@@ -186,8 +183,6 @@ async def test_client_create_signed_url(
186183
file.bucket_path, file.local_path, {"content-type": file.mime_type}
187184
)
188185

189-
sleep(3)
190-
191186
signed_url = (await storage_file_client.create_signed_url(file.bucket_path, 10))[
192187
"signedURL"
193188
]
@@ -207,11 +202,9 @@ async def test_client_get_public_url(
207202
file.bucket_path, file.local_path, {"content-type": file.mime_type}
208203
)
209204

210-
sleep(3)
211-
212205
public_url = await storage_file_client_public.get_public_url(file.bucket_path)
213206

214-
async with HttpxClient() as client:
207+
async with HttpxClient(timeout=None) as client:
215208
response = await client.get(public_url)
216209
response.raise_for_status()
217210

tests/_sync/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ def storage() -> SyncStorageClient:
3232
"Authorization": f"Bearer {key}",
3333
},
3434
) as client:
35+
client.session.timeout = None
3536
yield client

tests/_sync/test_client.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass
4-
from time import sleep
54
from typing import TYPE_CHECKING
65
from uuid import uuid4
76

@@ -166,8 +165,6 @@ def test_client_upload(
166165
file.bucket_path, file.local_path, {"content-type": file.mime_type}
167166
)
168167

169-
sleep(3)
170-
171168
image = storage_file_client.download(file.bucket_path)
172169
files = storage_file_client.list(file.bucket_folder)
173170
image_info = next((f for f in files if f.get("name") == file.name), None)
@@ -184,8 +181,6 @@ def test_client_create_signed_url(
184181
file.bucket_path, file.local_path, {"content-type": file.mime_type}
185182
)
186183

187-
sleep(3)
188-
189184
signed_url = (storage_file_client.create_signed_url(file.bucket_path, 10))[
190185
"signedURL"
191186
]
@@ -205,11 +200,9 @@ def test_client_get_public_url(
205200
file.bucket_path, file.local_path, {"content-type": file.mime_type}
206201
)
207202

208-
sleep(3)
209-
210203
public_url = storage_file_client_public.get_public_url(file.bucket_path)
211204

212-
with HttpxClient() as client:
205+
with HttpxClient(timeout=None) as client:
213206
response = client.get(public_url)
214207
response.raise_for_status()
215208

0 commit comments

Comments
 (0)