Enable pytest-asyncio tests in CI (#3)

* Set asyncio_mode="auto" in pytest.ini config

Xref https://pytest-asyncio.readthedocs.io/en/latest/reference/configuration.html#asyncio-mode

* Add test-python GitHub Actions CI workflow

* Add `--color=yes` flag to force GitHub Actions logs to have color

Xref https://github.com/pytest-dev/pytest/issues/7443

* Refactor contents of test_api.py slightly

Using some ruff rules

* Delete test_api.py

* Make test_get_place async

* Make get_place async, and call .ainvoke method on it
This commit is contained in:
Wei Ji
2025-12-04 13:09:02 +00:00
committed by GitHub
parent 93b405cda4
commit 2d5af2adb9
5 changed files with 54 additions and 53 deletions
+4 -3
View File
@@ -1,14 +1,15 @@
from langchain_core.tools.base import ToolCall
from geo_assistant.tools.overture import get_place
def test_get_place():
command = get_place.invoke(
async def test_get_place():
command = await get_place.ainvoke(
ToolCall(
name="get_place",
type="tool_call",
id="test_id",
args={"place_name": "Neighboourhood Cafe Lisbon"},
args={"place_name": "Neighbourhood Cafe Lisbon"},
)
)
assert "place" in command.update