Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjambrecic committed Jan 17, 2025
1 parent a5d8ea1 commit 42aead0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/agentchat/test_agent_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import json
import sqlite3
import uuid
from typing import Any, Generator
from typing import Any, Generator, Optional

import pytest
from _pytest.mark import ParameterSet
Expand Down Expand Up @@ -43,7 +43,7 @@


@pytest.fixture(scope="function")
def db_connection() -> Generator[sqlite3.Connection | None, Any, None]:
def db_connection() -> Generator[Optional[sqlite3.Connection], Any, None]:
autogen.runtime_logging.start(config={"dbname": ":memory:"})
con = autogen.runtime_logging.get_connection()
con.row_factory = sqlite3.Row
Expand All @@ -53,7 +53,7 @@ def db_connection() -> Generator[sqlite3.Connection | None, Any, None]:


def _test_two_agents_logging(
credentials: Credentials, db_connection: Generator[sqlite3.Connection | None, Any, None], row_classes: list[str]
credentials: Credentials, db_connection: Generator[Optional[sqlite3.Connection], Any, None], row_classes: list[str]
) -> None:
cur = db_connection.cursor()

Expand Down Expand Up @@ -177,7 +177,7 @@ def _test_two_agents_logging(
def test_two_agents_logging(
credentials_fixture: ParameterSet,
request: pytest.FixtureRequest,
db_connection: Generator[sqlite3.Connection | None, Any, None],
db_connection: Generator[Optional[sqlite3.Connection], Any, None],
) -> None:
credentials = request.getfixturevalue(credentials_fixture)
# Determine the client classes based on the markers applied to the current test
Expand Down Expand Up @@ -269,7 +269,7 @@ def _test_groupchat_logging(credentials: Credentials, credentials2: Credentials,
def test_groupchat_logging(
credentials_fixture: ParameterSet,
request: pytest.FixtureRequest,
db_connection: Generator[sqlite3.Connection | None, Any, None],
db_connection: Generator[Optional[sqlite3.Connection], Any, None],
) -> None:
credentials = request.getfixturevalue(credentials_fixture)
_test_groupchat_logging(credentials, credentials, db_connection)

0 comments on commit 42aead0

Please sign in to comment.