mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 14:32:36 +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"
|
test_content = b"files test content"
|
||||||
|
|
||||||
|
uploaded_file = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Upload file using OpenAI client
|
# Upload file using OpenAI client
|
||||||
with BytesIO(test_content) as file_buffer:
|
with BytesIO(test_content) as file_buffer:
|
||||||
|
|
@ -70,7 +72,7 @@ def test_openai_client_basic_operations(openai_client):
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
# Cleanup in case of failure
|
# Cleanup in case of failure
|
||||||
if "uploaded_file" in locals(): # maybe create fails
|
if uploaded_file is not None:
|
||||||
try:
|
try:
|
||||||
client.files.delete(uploaded_file.id)
|
client.files.delete(uploaded_file.id)
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue