Skip to content

Fix tests #19

@brylie

Description

@brylie

https://github.com/brylie/langflow-fastapi-htmx/actions/runs/9816385906/job/27106524769#step:6:1

==================================== ERRORS ====================================
________________ ERROR collecting tests/test_chat_gpt_client.py ________________
tests/test_chat_gpt_client.py:3: in
from app.chat_gpt_client import get_chat_response_with_history, Message, MessageRole
app/chat_gpt_client.py:29: in
client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY"))
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/openai/_client.py:316: in init
raise OpenAIError(
E openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
_____________________ ERROR collecting tests/test_main.py ______________________
tests/test_main.py:3: in
from app.main import app
app/main.py:11: in
from app.chat_gpt_client import get_chat_response_with_history, Message, MessageRole
app/chat_gpt_client.py:29: in
client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY"))
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/openai/_client.py:316: in init
raise OpenAIError(
E openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
=========================== short test summary info ============================
ERROR tests/test_chat_gpt_client.py - openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
ERROR tests/test_main.py - openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 1.05s ===============================
Error: Process completed with exit code 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions