Skip to content

Commit 017e112

Browse files
committed
refactor fixtures
1 parent 5db2a8c commit 017e112

4 files changed

Lines changed: 21 additions & 28 deletions

File tree

py/src/braintrust/wrappers/agno/_test_agno_helpers.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,11 @@
55

66
from inspect import isawaitable
77

8-
import pytest
9-
from braintrust import logger
10-
from braintrust.test_helpers import init_test_logger
118
from braintrust.wrappers.agno.agent import wrap_agent
129

1310
PROJECT_NAME = "test-agno-app"
1411

1512

16-
@pytest.fixture
17-
def memory_logger():
18-
init_test_logger(PROJECT_NAME)
19-
with logger._internal_with_memory_background_logger() as bgl:
20-
yield bgl
21-
22-
2313
class FakeMetrics:
2414
def __init__(self):
2515
self.input_tokens = 1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
from braintrust import logger
5+
from braintrust.test_helpers import init_test_logger
6+
7+
from ._test_agno_helpers import PROJECT_NAME
8+
9+
10+
@pytest.fixture
11+
def memory_logger():
12+
init_test_logger(PROJECT_NAME)
13+
with logger._internal_with_memory_background_logger() as bgl:
14+
yield bgl
15+
16+
17+
@pytest.fixture(scope="module")
18+
def vcr_config():
19+
return {
20+
"cassette_library_dir": str(Path(__file__).parent.parent / "cassettes"),
21+
}

py/src/braintrust/wrappers/agno/test_agno.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# pyright: reportUnknownParameterType=false
55
# pyright: reportUnknownVariableType=false
66
# pyright: reportUnknownArgumentType=false
7-
from pathlib import Path
8-
97
import pytest
108
from braintrust.logger import start_span
119
from braintrust.wrappers.agno import agent as agno_agent_module
@@ -27,13 +25,6 @@
2725
)
2826

2927

30-
@pytest.fixture(scope="module")
31-
def vcr_config():
32-
return {
33-
"cassette_library_dir": str(Path(__file__).parent.parent / "cassettes"),
34-
}
35-
36-
3728
@pytest.mark.vcr
3829
def test_agno_simple_agent_execution(memory_logger):
3930
agent_module = pytest.importorskip("agno.agent")

py/src/braintrust/wrappers/agno/test_workflow.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# pyright: reportUnknownParameterType=false
55
# pyright: reportUnknownVariableType=false
66
# pyright: reportUnknownArgumentType=false
7-
from pathlib import Path
8-
97
import pytest
108
from braintrust.wrappers.agno import setup_agno
119
from braintrust.wrappers.agno.workflow import wrap_workflow
@@ -21,13 +19,6 @@
2119
)
2220

2321

24-
@pytest.fixture(scope="module")
25-
def vcr_config():
26-
return {
27-
"cassette_library_dir": str(Path(__file__).parent.parent / "cassettes"),
28-
}
29-
30-
3122
@pytest.mark.vcr
3223
def test_agno_workflow_with_agent(memory_logger):
3324
agent_module = pytest.importorskip("agno.agent")

0 commit comments

Comments
 (0)