Skip to content

Commit

Permalink
Added change to make tests backwards compatible (#14)
Browse files Browse the repository at this point in the history
* Added change to make tests backwards compatible with new httpx_mock version

* Update test_simple_agent.py

* Update test_simple_chat_agent.py

* Update test_tools.py

* Added changelog

* Reformatted with proper ruff version
  • Loading branch information
cszsol authored Oct 1, 2024
1 parent 4f69726 commit 198c76d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed a bug that prevented AsyncSqlite checkpoint to access the DB in streamed endpoints.
- Fixed a bug that caused some unit tests to fail due to a change in how httpx_mock works in version 0.32

## [0.1.0] - 19.09.2024

Expand Down
2 changes: 2 additions & 0 deletions tests/agents/test_simple_chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from neuroagent.agents import AgentOutput, AgentStep, SimpleChatAgent


@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
@pytest.mark.asyncio
async def test_arun(fake_llm_with_tools, httpx_mock):
llm, tools, fake_responses = await anext(fake_llm_with_tools)
Expand Down Expand Up @@ -64,6 +65,7 @@ async def test_arun(fake_llm_with_tools, httpx_mock):
assert len(messages_list) == 10


@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
@pytest.mark.asyncio
async def test_astream(fake_llm_with_tools, httpx_mock):
llm, tools, fake_responses = await anext(fake_llm_with_tools)
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ async def test_get_kg_data_errors(httpx_mock):
)


@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
@pytest.mark.asyncio
async def test_get_kg_data(httpx_mock):
url = "http://fake_url"
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_electrophys_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


class TestElectrophysTool:
@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
@pytest.mark.asyncio
async def test_arun(self, httpx_mock):
url = "http://fake_url"
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_traces_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


class TestTracesTool:
@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
@pytest.mark.asyncio
async def test_arun(self, httpx_mock, brain_region_json_path):
url = "http://fake_url"
Expand Down

0 comments on commit 198c76d

Please sign in to comment.