fix: use TestClient as context manager to trigger lifespan
This commit is contained in:
@@ -32,7 +32,7 @@ class TestAgentConstruction:
|
||||
|
||||
agent = Agent(model=mock_model)
|
||||
|
||||
assert agent.config.max_iterations == 10
|
||||
assert agent.config.max_iterations == 200
|
||||
assert "helpful assistant" in agent.config.system_prompt
|
||||
assert agent.tools == []
|
||||
|
||||
|
||||
@@ -5,9 +5,8 @@ from src.naliiabotapi.main import app
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
client = TestClient(app)
|
||||
|
||||
return client
|
||||
with TestClient(app) as client:
|
||||
yield client
|
||||
|
||||
|
||||
def test_root(client):
|
||||
|
||||
Reference in New Issue
Block a user