refactor: remove unnecessary 'client' fixture and update test durations (#4283)
* Remove unnecessary use of 'client' fixture in test_superuser * Remove unnecessary use of 'usefixtures' decorator in test files * Update test fixtures to improve test duration tracking * Remove unnecessary 'client' fixture from test cases
This commit is contained in:
parent
1ef1fcb515
commit
73b5cc0098
6 changed files with 601 additions and 605 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -81,7 +81,7 @@ def test_component_tool():
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.api_key_required
|
@pytest.mark.api_key_required
|
||||||
@pytest.mark.usefixtures("_add_toolkit_output", "client")
|
@pytest.mark.usefixtures("_add_toolkit_output")
|
||||||
def test_component_tool_with_api_key():
|
def test_component_tool_with_api_key():
|
||||||
chat_output = ChatOutput()
|
chat_output = ChatOutput()
|
||||||
openai_llm = OpenAIModelComponent()
|
openai_llm = OpenAIModelComponent()
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ from langflow.components.prompts import PromptComponent
|
||||||
from langflow.graph import Graph
|
from langflow.graph import Graph
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("client")
|
|
||||||
def test_edge_raises_error_on_invalid_target_handle():
|
def test_edge_raises_error_on_invalid_target_handle():
|
||||||
template = """Answer the user as if you were a pirate.
|
template = """Answer the user as if you were a pirate.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ AI: """
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("client")
|
|
||||||
def test_memory_chatbot(memory_chatbot_graph):
|
def test_memory_chatbot(memory_chatbot_graph):
|
||||||
# Now we run step by step
|
# Now we run step by step
|
||||||
expected_order = deque(["chat_input", "chat_memory", "prompt", "openai", "chat_output"])
|
expected_order = deque(["chat_input", "chat_memory", "prompt", "openai", "chat_output"])
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ def test_components_path(runner, default_settings, tmp_path):
|
||||||
assert str(temp_dir) in settings_service.settings.components_path
|
assert str(temp_dir) in settings_service.settings.components_path
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("client")
|
|
||||||
def test_superuser(runner):
|
def test_superuser(runner):
|
||||||
result = runner.invoke(app, ["superuser"], input="admin\nadmin\n")
|
result = runner.invoke(app, ["superuser"], input="admin\nadmin\n")
|
||||||
assert result.exit_code == 0, result.stdout
|
assert result.exit_code == 0, result.stdout
|
||||||
|
|
|
||||||
|
|
@ -632,7 +632,6 @@ async def test_load_flows(client: TestClient):
|
||||||
assert response.json()["folder_id"] is not None
|
assert response.json()["folder_id"] is not None
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("client")
|
|
||||||
def test_sqlite_pragmas():
|
def test_sqlite_pragmas():
|
||||||
db_service = get_db_service()
|
db_service = get_db_service()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue