ref: Add ruff rules for bugbear (B) (#3983)

Add ruff rules for bugbear (B)
This commit is contained in:
Christophe Bornet 2024-10-02 18:55:51 +02:00 • committed by GitHub
commit 7e3d470845
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
86 changed files with 267 additions and 230 deletions

View file

@ -1,6 +1,8 @@
import logging
from collections import deque
import pytest
from pytest import LogCaptureFixture
from langflow.components.agents.ToolCallingAgent import ToolCallingAgentComponent
from langflow.components.inputs.ChatInput import ChatInput
@ -28,14 +30,16 @@ async def test_graph_not_prepared():
@pytest.mark.asyncio
async def test_graph():
async def test_graph(caplog: LogCaptureFixture):
chat_input = ChatInput()
chat_output = ChatOutput()
graph = Graph()
graph.add_component(chat_input)
graph.add_component(chat_output)
with pytest.warns(UserWarning, match="Graph has vertices but no edges"):
caplog.clear()
with caplog.at_level(logging.WARNING):
graph.prepare()
assert "Graph has vertices but no edges" in caplog.text
@pytest.mark.asyncio