mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-09-09 21:49:37 +00:00
test: isolate Jina timeout logging from missing-key warning (#5139)
This commit is contained in:
parent
fb722770e4
commit
3ac40bf9bd
@ -242,6 +242,10 @@ Direct pytest collection or execution of `tests/test_client_live.py` remains
|
||||
skipped unless `DEER_FLOW_RUN_LIVE_TESTS=1` is set. Do not add that opt-in to
|
||||
default CI workflows.
|
||||
|
||||
Jina request-failure logging tests set a dummy API key so the separate once-per-process
|
||||
missing-key warning cannot make assertions depend on test order or shard placement.
|
||||
Missing-key behavior has its own tests in `tests/test_jina_client.py`.
|
||||
|
||||
### Running the Full Application
|
||||
|
||||
From the **project root** directory:
|
||||
|
||||
@ -89,6 +89,9 @@ async def test_crawl_network_error(jina_client, monkeypatch):
|
||||
async def test_crawl_transient_failure_logs_without_traceback(jina_client, monkeypatch, caplog):
|
||||
"""Transient network failures must log at WARNING without a traceback and include the exception type."""
|
||||
|
||||
# Keep the missing-key warning independent of test order and shard placement.
|
||||
monkeypatch.setenv("JINA_API_KEY", "test-key")
|
||||
|
||||
async def mock_post(self, url, **kwargs):
|
||||
raise httpx.ConnectTimeout("timed out")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user