Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

test: Catch multi-threading error

Clémence Lesnée10b0a6700da
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 97411ad..456c4fb 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -3,6 +3,7 @@ black[jupyter]==24.2.0
deepeval==0.20.89
pur==7.3.1
pytest-asyncio==0.23.5.post1 # Required for pytest
+pytest-repeat==0.9.3 # Required for pytest
pytest-xdist[psutil]==3.5.0 # Required for pytest
pytest==8.1.1
watchfiles==0.21.0 # Required for uvicorn auto-reload
diff --git a/tests/cache.py b/tests/cache.py
index 3d93438..e25a578 100644
--- a/tests/cache.py
+++ b/tests/cache.py
@@ -20,6 +20,7 @@ _cache = CONFIG.cache.instance()
],
)
@pytest.mark.asyncio
[email protected](10) # Catch multi-threading and concurrency issues
async def test_acid(random_text: str, cache_mode: CacheModeEnum) -> None:
# Set cache mode
CONFIG.cache.mode = cache_mode
diff --git a/tests/llm.py b/tests/llm.py
index 2eb4eae..9e8ef52 100644
--- a/tests/llm.py
+++ b/tests/llm.py
@@ -140,6 +140,7 @@ CONFIG.workflow.lang.default_short_code = "en-US" # Force language to English
],
)
@pytest.mark.asyncio
[email protected](3) # Catch non deterministic issues
async def test_llm(
call_mock: CallModel,
claim_tests_excl: list[str],
diff --git a/tests/search.py b/tests/search.py
index db836bb..9fe9ff6 100644
--- a/tests/search.py
+++ b/tests/search.py
@@ -36,6 +36,7 @@ _search = CONFIG.ai_search.instance()
],
)
@pytest.mark.asyncio
[email protected](10) # Catch multi-threading and concurrency issues
async def test_relevancy(
call_mock: CallModel,
deepeval_model: DeepEvalBaseLLM,
diff --git a/tests/store.py b/tests/store.py
index 8bf3373..209e0e0 100644
--- a/tests/store.py
+++ b/tests/store.py
@@ -21,6 +21,7 @@ _db = CONFIG.database.instance()
],
)
@pytest.mark.asyncio
[email protected](10) # Catch multi-threading and concurrency issues
async def test_acid(call_mock: CallModel, database_mode: DatabaseModeEnum) -> None:
# Set database mode
CONFIG.database.mode = database_mode