mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 12:42:37 +00:00
use None instead of locals()
This commit is contained in:
parent
3fceb28a39
commit
ccea70349e
1 changed files with 3 additions and 1 deletions
|
|
@ -27,6 +27,8 @@ def test_openai_client_basic_operations(openai_client):
|
|||
|
||||
test_content = b"files test content"
|
||||
|
||||
uploaded_file = None
|
||||
|
||||
try:
|
||||
# Upload file using OpenAI client
|
||||
with BytesIO(test_content) as file_buffer:
|
||||
|
|
@ -70,7 +72,7 @@ def test_openai_client_basic_operations(openai_client):
|
|||
|
||||
finally:
|
||||
# Cleanup in case of failure
|
||||
if "uploaded_file" in locals(): # maybe create fails
|
||||
if uploaded_file is not None:
|
||||
try:
|
||||
client.files.delete(uploaded_file.id)
|
||||
except NotFoundError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue