Skip to content

Commit e5097a0

Browse files
jackaldenryanclaude
andcommitted
refactor: Update pytest fixtures to follow project conventions
- Add name= argument to all @pytest.fixture decorators - Rename fixture functions to start with fixture_ prefix - Add precise return type hints (AsyncMock, Mock, AutoMemoryWrapperGraph) - Follow <CHORUS_TAG>pytest.fixture</CHORUS_TAG>(name="...") convention 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: jackaldenryan <jackaldenryan@gmail.com>
1 parent e5831aa commit e5097a0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/nat/agent/test_auto_memory_wrapper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535
from nat.memory.models import MemoryItem
3636

3737

38-
@pytest.fixture
39-
def mock_memory_editor():
38+
@pytest.fixture(name="mock_memory_editor")
39+
def fixture_mock_memory_editor() -> AsyncMock:
4040
"""Create a mock MemoryEditor for testing."""
4141
editor = AsyncMock()
4242
editor.add_items = AsyncMock()
4343
editor.search = AsyncMock(return_value=[])
4444
return editor
4545

4646

47-
@pytest.fixture
48-
def mock_inner_agent():
47+
@pytest.fixture(name="mock_inner_agent")
48+
def fixture_mock_inner_agent() -> Mock:
4949
"""Create a mock inner agent function for testing."""
5050
mock_fn = Mock()
5151

@@ -65,17 +65,17 @@ async def _ainvoke(chat_request: ChatRequest):
6565
return mock_fn
6666

6767

68-
@pytest.fixture
69-
def mock_context():
68+
@pytest.fixture(name="mock_context")
69+
def fixture_mock_context() -> Mock:
7070
"""Create a mock Context for testing."""
7171
context = Mock(spec=Context)
7272
context.user_manager = None
7373
context.metadata = None
7474
return context
7575

7676

77-
@pytest.fixture
78-
def wrapper_graph(mock_inner_agent, mock_memory_editor, mock_context):
77+
@pytest.fixture(name="wrapper_graph")
78+
def fixture_wrapper_graph(mock_inner_agent, mock_memory_editor, mock_context) -> AutoMemoryWrapperGraph:
7979
"""Create an AutoMemoryWrapperGraph instance for testing."""
8080
with patch('nat.agent.auto_memory_wrapper.agent.Context.get', return_value=mock_context):
8181
return AutoMemoryWrapperGraph(inner_agent_fn=mock_inner_agent,

0 commit comments

Comments
 (0)