Skip to content

Commit 0388ebb

Browse files
🐛 Dont fail when cleaning up (#222)
1 parent bcdd677 commit 0388ebb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

clients/python/test/e2e/conftest.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
_MB: ByteSize = ByteSize(_KB * 1024) # in bytes
3131
_GB: ByteSize = ByteSize(_MB * 1024) # in bytes
3232

33+
_logger = logging.getLogger(__name__)
34+
3335
# Dictionary to store start times of tests
3436
_test_start_times = {}
3537

@@ -172,7 +174,13 @@ def large_server_file(
172174
upload_ram_usage=max(ram_statistics) - min(ram_statistics),
173175
)
174176

175-
files_api.delete_file(uploaded_file.id)
177+
try:
178+
files_api.delete_file(uploaded_file.id)
179+
except osparc.ApiException:
180+
_logger.warning(
181+
f"Could not delete file on server in {file_with_number.__name__}",
182+
exc_info=True,
183+
)
176184

177185

178186
@pytest.fixture
@@ -206,4 +214,10 @@ def file_with_number(
206214
server_file = files_api.upload_file(file)
207215
yield server_file
208216

209-
files_api.delete_file(server_file.id)
217+
try:
218+
files_api.delete_file(server_file.id)
219+
except osparc.ApiException:
220+
_logger.warning(
221+
f"Could not delete file on server in {file_with_number.__name__}",
222+
exc_info=True,
223+
)

0 commit comments

Comments
 (0)